Remove Extra Spaces
Clean up spacing in pasted text: double spaces, stray tabs, trailing spaces and runs of blank lines.
Processed locally in your browser/ Your data stays in your browser.
What is Remove Extra Spaces?
Copied text often carries extra whitespace: two spaces after a period, tabs, trailing spaces, non-breaking spaces from web pages and stacks of blank lines. This tool normalizes all of it in one pass, with a checkbox for every step.
You can collapse repeated spaces (and tabs) to a single space, trim the start and end of each line, convert non-breaking and other Unicode spaces to normal ones, remove all blank lines or limit consecutive blank lines to a number you choose, and optionally remove spaces before punctuation such as commas and periods. The notes tell you how many characters were removed.
How does it work?
- Paste your text with the extra spacing.
- Keep the defaults (collapse spaces, trim lines and text, convert special spaces) or switch each option on and off.
- Set how many consecutive blank lines to keep (0 means unlimited), then copy the tidy text.
Common use cases
- Cleaning text copied from PDFs, e-mails or web pages before publishing.
- Removing double spaces after periods from an old document.
- Normalizing whitespace before comparing two versions of a text.
- Compacting pasted lists and addresses.
Examples
Try this input in the tool above:
Too many spaces here. And here too ! Tabs as well.
Too many spaces here. And here too ! Tabs as well.
Privacy
Remove Extra Spaces runs entirely in your browser. The text or files you provide are processed on your device and are not uploaded, logged or stored on our servers.
Limitations
Removing the space before punctuation is wrong for French, which requires a space before ! ? : ; and is therefore off by default. Spaces inside code blocks, tables or ASCII art will also be collapsed if the option is on.
Frequently asked questions
Are line breaks removed?
No. Only spaces and tabs are collapsed, and blank lines are removed or limited only if you choose so.
What are non-breaking spaces?
Invisible space characters (U+00A0 and others) that look like spaces but are not matched by normal search. The tool converts them to ordinary spaces by default.
Related tools
Text Cleaner
Sanitize text copied from the web, documents or AI chats: invisible characters, curly quotes, odd spaces and Unicode quirks, each step under your control.
Text Tools
Trim Lines
Remove the spaces and tabs at the start and end of each line of a list or block of text.
Text Tools
Remove Empty Lines
Strip blank lines from pasted text in one click, or keep a single blank line between paragraphs.
Text Tools
Find and Replace
Search a block of text and replace every occurrence, as plain text or with a regular expression and capture groups.
Text Tools
Word Counter
Paste an essay, article or caption and get words, characters, sentences, paragraphs, reading time and the most used words instantly.
Text Tools
Case Converter
One tool for every text case: pick a style from the list and the text is converted instantly.
Text Tools