Remove Extra Spaces
Clean up messy spacing in one step: collapse double spaces, trim every line, turn tabs and non-breaking spaces into normal spaces and delete invisible zero-width characters. Optionally join lines broken by PDFs and emails back into paragraphs.
Why Text Ends Up With Extra Spaces
Double spaces, tabs and invisible characters sneak in from PDFs, Word, web pages and emails.
Copying text from a PDF, a Word document, a website or an email often brings unwanted spacing along: double spaces after sentences, tabs used for alignment, non-breaking spaces ( ) that look normal but don't behave like spaces, and zero-width characters that are completely invisible yet break searches, comparisons and code.
This tool removes all of them. Each cleanup step can be switched on or off, so you control exactly what changes.
Text from PDFs and some emails has a hard line break at the end of every visual line. Join lines, keep paragraphs merges those lines back into flowing paragraphs while keeping the blank lines between paragraphs. Join into one line turns everything into a single line — handy for spreadsheet cells and form fields.
Need to keep code indentation? Turn off Trim line starts & ends — repeated spaces inside lines are still collapsed, but each line keeps its leading spaces.
Spaces This Tool Handles
Characters that look like spaces (or like nothing at all).
Repeated spaces
Two or more spaces in a row become one. With Tabs → spaces on, tabs count too.
Leading & trailing spaces
Spaces and tabs at the start and end of each line — and at the start and end of the whole text.
Unicode spaces
Non-breaking (U+00A0), narrow no-break (U+202F), en/em/thin/hair spaces (U+2000–U+200A), medium mathematical space (U+205F) and the ideographic space (U+3000).
Invisible characters
Zero-width space, non-joiner and joiner (U+200B–U+200D), word joiner (U+2060) and the byte-order mark (U+FEFF). Note: emoji sequences use U+200D — this option can split them.
How to Use the Remove Extra Spaces
Get your result in under ten seconds.
Paste your text
Or open/drop a file. The cleaned text appears instantly.
Choose the cleanups
All common fixes are on by default. Choose how to treat line breaks.
Copy or download
Copy the result or download it as a .txt file.
Why Use the Remove Extra Spaces on Developers Web Tools
Fast, accurate and private — built for developers.
Finds invisible junk
Zero-width characters and BOMs are removed — even though you can't see them.
Fixes odd spaces
Non-breaking and typographic spaces become normal spaces.
Rejoins PDF text
Merge broken lines into paragraphs without losing paragraph breaks.
Keeps indentation
Turn off trimming to keep leading spaces in code.
Fast on big files
Large text is processed in a background thread.
Private
Your text never leaves your browser.
Frequently Asked Questions
Paste your text — Collapse repeated spaces is on by default, so every run of two or more spaces becomes a single space.
They're probably non-breaking spaces ( ) or other Unicode spaces that look identical to normal spaces. Fix odd spaces converts them first, so they're collapsed and trimmed like normal ones.
Invisible characters such as U+200B (zero-width space) and U+FEFF (byte-order mark). They often come from web pages and word processors and can break code, URLs and data imports. Remove invisible characters deletes them. Turn it off for text with complex emoji, which use the zero-width joiner.
Choose Join lines, keep paragraphs. Single line breaks are replaced by spaces, while empty lines between paragraphs are kept as paragraph breaks.
Yes. Turn off Trim line starts & ends and Tabs → spaces. Leading indentation stays; repeated spaces later in the line are still collapsed.
No. Everything runs locally in your browser.