Remove Extra Spaces
Collapse double spaces, trim lines, normalise tabs and non-breaking spaces, and limit blank lines in one pass.
This guide is not yet available in your language and is shown in English.
Tool guide
What this tool does
Remove Extra Spaces tidies text pasted from PDFs, emails and websites. It collapses runs of spaces, trims each line, converts non-breaking and other Unicode spaces, removes zero-width characters, replaces tabs, fixes spaces before punctuation and caps the number of blank lines between paragraphs.
Text copied from a PDF, a web page or an old document often carries messy spacing: double spaces after full stops, indents made of tabs, trailing blanks at line ends and runs of empty lines. Less visibly, it may contain non-breaking spaces (U+00A0), narrow no-break spaces or zero-width spaces that look identical to normal spaces but break searches, word counts and spreadsheet formulas.
This tool cleans all of these in one pass with options you can switch on and off. Unicode space separators such as en and em spaces and the ideographic space are converted to ordinary spaces, zero-width characters are removed, and multiple spaces collapse to one. Line structure is preserved: each line is trimmed separately, and you decide how many blank lines may separate paragraphs.
How to use Remove Extra Spaces
- Paste your text into the input, or press Sample to see a messy example.
- Keep “Collapse repeated spaces into one” and the trimming options on for a general clean-up.
- Choose what to do with Tabs: replace with a space, replace with four spaces, or keep them.
- Set “Blank lines between paragraphs” to remove them all, allow one or two, or leave them unchanged.
- Turn on “Fix spaces around punctuation and brackets” to change “word ,” into “word,” and “( text )” into “(text)”.
- Check Characters removed, then copy or download the clean text.
Tips for better results
- Turn on “Remove every space and tab” to clean phone numbers, card numbers or IBANs before pasting them into a form.
- If a spreadsheet lookup fails on values that look identical, a non-breaking space is the usual culprit; the Unicode space option fixes it.
- Keep tabs if you are cleaning tab-separated data copied from a spreadsheet, or the columns will merge.
- Run Remove Line Breaks afterwards if the text also has hard line breaks in the middle of sentences.
Common use cases
- Tidying text copied from PDF files before editing it.
- Preparing product descriptions for an online shop import.
- Cleaning survey answers or form submissions before analysis.
- Normalising code comments or Markdown that mixes tabs and spaces.
Common mistakes to avoid
- Cleaning source code or YAML with tab conversion and line trimming on, which can change indentation that the format depends on.
- Collapsing spaces in fixed-width tables, which destroys column alignment.
- Removing all blank lines from prose, which merges paragraphs into one block.
Frequently asked questions
What counts as an extra space?
Any run of two or more spaces between words, spaces at the start or end of a line, and blank lines beyond the limit you set. Single spaces between words are never removed unless you choose to remove every space.
What is a non-breaking space and why convert it?
A non-breaking space (U+00A0) looks like a normal space but stops a line wrapping at that point. Word processors and web pages insert them automatically, and they break searches and comparisons, so converting them to ordinary spaces makes text behave predictably.
Will it remove line breaks?
No. Line breaks are kept; only blank lines beyond your chosen limit are removed. To join lines into paragraphs, use Remove Line Breaks.
Are zero-width characters removed?
Yes, when the option is on: zero-width space, zero-width joiner and non-joiner, word joiner and the byte-order mark. Turn it off for scripts that need the joiners, such as some Indic and emoji sequences.
Feedback & suggestions
Help us improve Remove Extra Spaces. We read every message.