Remove extra spaces
Collapse double spaces and tabs and trim blank lines, keeping your line breaks.
Paste prose. Indentation is removed; do not use this on source code.
Processed in your browser. The text is not uploaded.Read the privacy policy.
Cleaned text
No text yet. Paste, type, or load the sample.
Spaces and tabs inside a line become one space. Each line is trimmed. Three or more line breaks become one blank line. Wrapped lines stay wrapped.
—
- Characters in
- —
- Characters out
- —
- Removed
- —
How to remove extra spaces
- Paste the prose. If it is source code, stop here. Indentation will be stripped.
- Read the result. Spaces and tabs inside a line become a single space. Each line is trimmed.
- Check the blank lines. Three or more line breaks become one blank line, which is one paragraph break.
- Copy the result, or use it as the new input if you want to run another tool. Then open the character counter if a limit was the reason you cleaned.
Exactly what is stripped
The cleaner normalizes Windows and old Mac line endings to a single newline, then walks each line. Runs of spaces and tabs become one space. The start and end of the line are trimmed, so a trailing space before a line break goes away. After the lines are rejoined, any run of three or more newlines becomes two newlines: one blank line between paragraphs. The start and end of the whole text are trimmed too. Letter case is not touched. Punctuation is not touched. Words are not removed.
The loaded sample is built to show that behavior. Cleaning it removes 13 characters and leaves the paragraph break that was a real blank line. Your text will not remove the same number. The panel reports the count for whatever is in the box.
What it will not do is join “wrapped” and “at the margin” into one line. A PDF that broke the sentence with a single return still has that return after this cleaner. UseRemove line breaks for that. Repeated lines, such as a duplicated heading, are also left alone. Use Remove duplicate lines when the repeated unit is a whole line rather than a space.
Why this is not the character counter
Extra spaces change a character count and usually do not change a word count, because the word counter already treats any whitespace run as a separator. If an editor rejected a blurb for length, cleaning spaces can be the whole fix. If they rejected it for word count, cleaning spaces will disappoint you. Count words on the word counter before you assume the spaces were the problem.
Limitations
- Indentation is removed. This is unsafe for code, poetry that uses leading spaces, and aligned columns.
- A double space that you meant as a sentence spacer, in the older typographic habit, becomes one space. The page assumes one space between sentences.
- Non-breaking spaces and other unusual Unicode spaces are not all treated as the same character as a normal space. A stubborn gap may be one of those. Replace it in your editor if it survives.
- The cleaner is lossy by design. It does not keep a server-side original. Copy first if you might want the messy version back.
Questions people ask
Will this join lines that a PDF wrapped?
No. Single line breaks stay. This tool collapses spaces and tabs inside a line, trims each line, and reduces three or more line breaks to one blank line. If the problem is a break in the middle of a sentence, use Remove line breaks instead.
Does it protect indentation in code?
No. Leading spaces on a line are removed. The page is for prose: notes, essays, and pasted articles. Do not run it on Python, YAML, or any text where indentation is meaningful.
Why did the character count drop?
Because spaces are characters. The result panel shows characters in and characters out. The sample on this page removes a known number of extra characters. Your draft will differ. Recount on the character counter if a limit is close.
Are paragraph breaks removed?
One blank line is kept, so a normal paragraph break survives. Extra blank lines beyond that are collapsed. If you needed every blank line for a poem, do not use this cleaner.
Is the text uploaded to be cleaned?
No. The cleaner runs in the browser. Copy the result if you want to keep it. Closing the tab drops both the original and the result.