Whitespace Remover: Clean Up Extra Spaces, Tabs and Line Breaks

Remove extra spaces, trailing whitespace, tabs and blank lines from your text and code, and keep the paragraphs if you want them. Just want every space gone? Use the Space Remover.

Cleanup mode
0 characters
0 characters

Frequently asked questions

What exactly does it clean up?

Repeated spaces, tabs, trailing spaces at the end of lines, excess blank lines, and the odd spaces left by PDFs and Word, including zero-width ones, each with its own setting.

What is the difference between the modes?

Keep line breaks, the default, tidies spaces and blank lines and leaves your paragraphs and lists where they are. Remove all breaks turns every run of spaces, tabs and line breaks into a single space, so the text comes back as one line. Choose what to clean opens the same settings as checkboxes, starting from the mode you were in.

Will it destroy my paragraph structure?

No. The default keeps every line break and brings several blank lines in a row down to one. Only Remove all breaks, or ticking Every line break under Choose what to clean, puts the text on one line.

The text looks identical. Did anything happen?

Probably, yes. Most of what gets cleaned here is invisible by nature - a second space, a tab, a non-breaking space that looks like an ordinary one. The count under the result says how many characters went, which is the quickest way to tell.

Why does text copied from a PDF have so much stray whitespace?

PDFs store text as positioned fragments rather than flowing lines, so copying often introduces extra spaces and line breaks. This tool is the quickest way to undo that. Whitespace you cannot see at all is a separate problem: see the Invisible Character Remover for no-break spaces and zero-width characters.