Free online tool

Remove extra spaces and hidden characters

Collapse double spaces, trim line edges, swap tabs and non-breaking spaces for normal spaces, delete invisible characters and tidy blank lines.

How to remove extra spaces

  1. 1Paste the messy text into the left box.
  2. 2Choose what to clean: double spaces, line edges, tabs, special spaces, invisible characters.
  3. 3Pick how to handle blank lines: keep, reduce to one, or remove.
  4. 4Press Copy result to take the clean text.

What gets cleaned

  • Multiple spaces between words become one.
  • Leading and trailing spaces on every line are removed, which also fixes ragged indentation from emails.
  • Tabs become ordinary spaces.
  • Special spaces (no-break, em, en, thin, narrow and ideographic spaces) become ordinary spaces.
  • Invisible characters (zero width space, zero width joiner and non-joiner, word joiner, byte order mark, soft hyphen) are deleted.
  • Blank lines are kept, reduced to one between paragraphs, or removed.

Hidden characters are a common cause of "this looks identical but does not match" problems in spreadsheets, logins and code. To see exactly which invisible characters a string contains before removing them, paste it into the Unicode lookup. If you need an invisible character on purpose, the invisible character tool has them ready to copy.

Frequently asked questions

How do I remove double spaces? +

Paste your text and keep "Collapse multiple spaces" ticked. Every run of two or more spaces becomes a single space, which fixes double spaces after full stops and gaps left by copying from PDFs or old documents.

What are non-breaking and invisible spaces? +

A non-breaking space (U+00A0) looks like a normal space but behaves differently in searches, formulas and code. Zero-width spaces, joiners and byte order marks are invisible characters that come along when text is copied from websites, chats or Word. Both can break spreadsheet lookups, logins and code; this tool replaces or removes them.

How do I remove extra spaces in Word? +

Open Find and Replace (Ctrl+H), type two spaces in Find what and one space in Replace with, and press Replace All repeatedly until Word finds none. For a one-step fix, tick Use wildcards and replace "( ){2,}" with "\1".

How do I remove extra spaces in Excel or Google Sheets? +

Use =TRIM(A1). It removes spaces at both ends and collapses double spaces inside the text. TRIM does not touch non-breaking spaces; wrap it as =TRIM(SUBSTITUTE(A1,CHAR(160)," ")) to catch those too.

Should there be one or two spaces after a full stop? +

One. Two spaces after a sentence was a typewriter convention; modern style guides, including APA, Chicago and AP, all use a single space, and proportional fonts already add the right amount of room.

Will this change my line breaks? +

Only blank lines, depending on the option: "Single blank lines" keeps paragraph breaks but removes extra empty lines between them. To remove line breaks altogether, use the remove line breaks tool.

✓ Copied to clipboard