Clean a line
- Input or situation
- red apple
- Result
- red apple
With Trim each line and Collapse repeated spaces enabled, the ends are trimmed and the three internal spaces become one.
Tidy extra spaces and blank lines in text copied from a document, spreadsheet or web page. Choose which cleanup rules to apply, then compare the result before using it.
Runs in your browser — your input is not uploaded to ToolsNow.
One may be a non-breaking space, U+00A0, which prevents a line wrapping there. This tool always converts it and several other Unicode spaces to ordinary spaces, even with all toggles off. Line endings are also normalised; this is not a byte-for-byte preservation tool.
Collapse blank lines keeps one empty line between paragraphs. Remove blank lines deletes the empty lines but leaves the text on separate lines. A line containing spaces becomes empty when Trim each line is enabled.
The default rules can remove indentation or change spaces inside string literals. Tabs → 2 spaces is also a text replacement, not a code-aware formatter, and tabs are required in some formats. Use a formatter for your language when spacing affects the meaning.
It removes spaces, tabs and line breaks, so "AB 12" becomes "AB12". This can help with a copied serial number, but it also joins ordinary words and can change a key or identifier if its spaces were intentional.
Tidy spaces in text copied from a PDF, spreadsheet or web page. Try trimming the ends of lines first, then remove extra spaces or blank lines if needed.
With Trim each line and Collapse repeated spaces enabled, the ends are trimmed and the three internal spaces become one.
Collapse blank lines keeps one empty line between paragraphs. Remove blank lines removes that separator completely.
Published by ToolsNow. How tools and sources are checked · Report a problem