Remove Extra Spaces
Tidy double spaces, ragged line ends and stray blank lines in one pass.
How to use the Remove Extra Spaces
- Paste the text you want to tidy.
- Extra spaces are removed and the result appears on the right as you type.
- Choose how lines are trimmed and how many blank lines may sit together.
- Copy the clean text or save it as a file.
Examples
About this tool
Spacing problems creep in quietly. Text copied out of a PDF or a slide often has two or three spaces between words, lines end in invisible spaces, and paragraphs are separated by a stack of empty lines. This cleaner fixes all of that while keeping your line breaks exactly where they were.
It also deals with spaces you cannot see. Web pages and word processors use no-break spaces, thin spaces and zero-width characters that look normal but make searches fail, spreadsheets treat a value as different, and code refuse to compile. With the replace option on, each becomes an ordinary space or disappears.
If you are cleaning source code or Markdown, choose "End only" for trimming. That removes trailing spaces, which version control tools flag as noise, without flattening the indentation that gives the code its structure.
Frequently asked questions
Will this join my lines together?
No. Every line stays a separate line. If you want to join lines that were wrapped by a PDF or an email, use the Remove Line Breaks tool instead.
What counts as an unusual space?
No-break spaces, the fixed-width spaces used in typesetting, the wide space used in Chinese and Japanese text, and zero-width characters such as the byte order mark. Joiners used inside emoji and some scripts are left alone so nothing breaks.
Why is the space before punctuation option off by default?
Some languages, French for example, put a space before ! ? : and ;. Turn it on only when the text is in a language that does not.
Is my text uploaded?
No. Cleaning happens instantly inside your browser, so contracts, code and personal notes stay on your own machine.