Remove extra spaces

Collapse repeated spaces, extra blank lines, and hard line breaks. A tidy pass also removes the space before punctuation.

0 characters · 0 words

All conversion happens on this device. Nothing is uploaded.

How to clean a paste

  1. Paste the text. PDF columns, emails, and copied captions are the usual sources of doubled spaces and broken lines.
  2. Pick one button. Collapse spaces joins horizontal whitespace only. Collapse blank lines reduces three or more line breaks to one blank line. Remove line breaks turns every line break into a space and trims the ends. Tidy all does the space collapse, the blank-line collapse, and it deletes a space before punctuation.
  3. Run case conversion after the cleanup, not before, if you also need Sentence case. A double space is not a sentence. The home converter will leave it alone. Clean first, then convert. The diff page can tidy and undo in one place if you want to see the spaces that disappeared.

Tabs and runs of ordinary spaces become a single space. A space before a line break and a space after a line break are removed by the space button, so a line no longer ends with invisible padding. The line breaks themselves stay. That is the difference between Collapse spaces and Remove line breaks. Use the first when the lines are real lines. Use the second when the lines are wrapping you did not want.

What each button changes

Collapse spaces does not touch a single space between words, and it does not merge paragraphs. a b with three spaces becomes a b. A tab is treated as space. A newline is not. Two newlines stay two newlines, which is one blank line. Three or more newlines are not reduced by this button. That is the blank-line button. Keeping them separate means you can flatten spaces inside a poem without deleting the stanza breaks.

Collapse blank lines turns three or more newlines into exactly two, which is a single blank line between paragraphs. It does not remove a single blank line, and it does not collapse spaces on the line. A line that contains only spaces is not a blank line to this button, because the newline count does not see the spaces. Run Collapse spaces first if the "blank" lines are actually padded. Tidy all runs the space pass before the blank-line pass so that padding is already gone.

Remove line breaks is the unwrap. Every run of newlines becomes one space, then repeated spaces collapse, then the ends are trimmed. A paragraph that was hard-wrapped at 72 columns becomes one line. You lose real paragraph breaks too. If the paste had blank lines you wanted to keep, do not use this button. Use Tidy all, which keeps a single blank line. Unwrap is for a quote or a caption that should be one paragraph and was split only by the source width.

Tidy all is the combination people want for prose. It collapses horizontal space, trims space at the edges of lines, reduces huge vertical gaps to one blank line, and deletes a space before a comma, period, semicolon, colon, question mark, or exclamation mark. hello , world becomes hello, world. It does not delete a space after punctuation. hello, world becomes hello, world because the repeated space collapses, not because of a special after-punctuation rule. It does not change quotes. Curly quotes are the straight quotes page. It does not change letter case, except that a saved exceptions spelling is written back afterward, the same way the other tools do it.

Edge cases

Carriage returns are normalized to line feeds by every button on this page. A Windows file that must keep carriage returns should not be cleaned here. The letters are not the point of that file. The bytes are. Copy the result into an editor that shows invisible characters if you are unsure what the button removed. The diff page is the easier view: deleted spaces show as their own struck-through tokens.

Indentation is not preserved. Leading spaces on a line are removed by Collapse spaces and by Tidy all. A code sample, a Python block, or a poem that uses leading spaces for meaning will be flattened. Do not tidy code here. The developer case converter is for identifier shape, and it is also the wrong tool for indentation. Leave code in an editor. This page is for prose pastes.

Non-breaking spaces and other unusual Unicode spaces are not all treated as ordinary spaces. The space buttons look for the common horizontal whitespace characters: space, tab, form feed, and vertical tab. A non-breaking space can survive and still look like a gap. If a count on the character counter stays high after a tidy, paste into an editor that can reveal the character. This page does not pretend to normalize every Unicode space.

A space before punctuation inside a number can be wrong to delete. 1 , 000 becomes 1,000 under Tidy all, which is often what you wanted and sometimes a thousands separator you meant to keep with spaces. The button does not know the locale. Locales that use a space as the thousands separator will lose it. Skip Tidy all and use Collapse spaces only, which reduces a run of spaces to one space but does not delete the space before the comma. Read a sample line before you clean a whole table of figures.

Empty input stays empty. A box that is only spaces becomes empty under Tidy all and under Remove line breaks, and becomes a shorter space run under Collapse spaces. The status line still reports the button name. Nothing is uploaded. If you also need each line capitalized after the unwrap, run capitalize each line only if the lines should stay lines. After an unwrap, use home Sentence case, because there is now one paragraph.

Frequently asked questions

Which button should I use for a PDF paragraph?

Remove line breaks if it should be one paragraph. Tidy all if there were real paragraph gaps you want to keep as a single blank line.

Will this join words that were hyphenated across a line break?

No. A hyphen at the end of a line stays, and the line break becomes a space if you unwrap. You get a hyphen and a space, not a joined word. Fix those breaks by hand.

Does tidy change straight quotes or case?

It does not change quotes or invent case. An exceptions list can still rewrite a saved spelling after the tidy. Curly quotes have their own page.

Can I keep code indentation?

No. Leading spaces are removed. Do not run source code through these buttons.