Loading Techie Utils…

Remove Extra Spaces & Whitespace

Trim, collapse and normalise whitespace. Free, and runs entirely in your browser — nothing you enter is uploaded, stored or sent to a server.

About Whitespace Remover

Clean-up mode trims each line, collapses runs of spaces, optionally drops empty lines and converts tabs to spaces. Strip-all mode removes every whitespace character, which is what you want for comparing a hash input or a fingerprint that was wrapped across lines.

Invisible whitespace is behind a disproportionate share of “these two strings are identical but the comparison fails” problems, especially after text has passed through a PDF, a spreadsheet or a chat client.

Where it helps

  • Individually controllable: trimming, collapsing, empty lines and tab conversion are separate switches.
  • Strip-all handles keys and fingerprints that were wrapped for display.
  • Fixes text pasted from PDFs and spreadsheets, which is riddled with stray spacing.
  • Runs locally on whatever you paste.

Limits

  • Whitespace is significant in YAML, Python and Markdown — cleaning those files can break them.
  • Non-breaking spaces and other exotic Unicode spaces are not the same character as a plain space; inspect with the Unicode Converter if something survives.
  • Line endings are normalised as a side effect of processing lines.
  • Removing whitespace is not reversible: the original spacing is gone.

Frequently asked questions

Will this fix my Python or YAML indentation?

It is more likely to break it. Both use indentation as syntax, so leave leading whitespace alone in those files.

A space survived the cleaning. Why?

It is probably U+00A0, a non-breaking space, which is a different character. Inspect the text with the Unicode Converter to confirm.

When would I remove all whitespace?

When comparing values that were wrapped for display — certificate fingerprints, Base64 blobs, hashes copied from a terminal.

Does it convert CRLF to LF?

Line endings are normalised as part of processing. If line endings are the actual problem, that side effect is usually the fix.

Related tools

More Text Tools tools

  • Markdown Viewer — Read a Markdown file the way it is meant to look, with its contents beside it
  • Markdown to HTML — Convert Markdown to HTML you can paste somewhere, with the rendered page beside it
  • Case Converter — Switch between sentence, camel, snake and other cases
  • Word Counter — Count words, characters, sentences and reading time
  • Text Comparison — Line-by-line diff of two blocks of text
  • Duplicate Remover — Remove, isolate or list duplicate lines
  • Sort Lines — Sort lines alphabetically, naturally, by number or length, reverse them, or shuffle them