Skip to content

Text Tools

Clean up text whitespace

Remove the spaces you can see, and the invisible characters you cannot.

  • Free, no signup
  • No upload — runs on your device
  • No watermark
  • Unlimited use

Remove Extra Spaces

Processed locally

The character breaking your code is probably U+00A0

Copy a line of code from a web page, a Word document or a Slack message and paste it into an editor. It looks correct. It does not run. The space between two tokens is a non-breaking space, U+00A0, which renders identically to a normal space and is a completely different character to every parser on earth.

Word inserts them automatically. Web pages use   for layout. Slack sometimes converts leading spaces. There are also zero-width spaces (U+200B) that occupy no visual width at all, and byte-order marks (U+FEFF) that lead a file and break JSON parsers with a message about an unexpected token at position 0.

None of these are visible in any editor without a "show invisibles" setting. This tool converts all three to ordinary spaces or removes them, and tells you how many it found — which is often the first confirmation that they were there.

How it works

  1. Paste your text
  2. Tick the cleanups you want
  3. Copy the cleaned text
Why nothing uploads. Every operation on this page happens inside your browser using JavaScript and WebAssembly. Your file is read into memory, processed, and offered back as a download. It is never transmitted. Disconnect from the internet after this page loads and the tool keeps working.

Frequently asked questions

What is a non-breaking space and why is it a problem?
It is U+00A0, a space that renders identically to a normal space but is a different character. Word and web pages insert them constantly, and they break code, CSV parsing and string comparisons in ways that are invisible on screen.
What is a zero-width space?
U+200B, a character with no visual width. It can appear in text copied from the web and cause string comparisons to fail for no apparent reason. This tool removes it.
Why does my JSON file fail to parse at position 0?
It probably starts with a byte-order mark, U+FEFF. It is invisible, and it is not valid JSON. Removing invisible characters here fixes it.
What are smart quotes and should I remove them?
The curly typographic quotes Word substitutes for straight ones. They are correct in prose and fatal in code and CSV files. Remove them when the text is destined for a machine.
Does this change my line breaks?
Only if you tick collapse blank lines, which reduces runs of three or more newlines to two. Single line breaks are never touched.