About this tool
Removes the invisible spaces that break spreadsheet lookups, form submissions and code diffs.
Removing invisible spaces that cause real problems
Extra spaces are hard to see but cause surprising trouble. A trailing space can make a spreadsheet lookup fail even though both values look identical. A leading space can stop a coupon code, email address or ID number from being accepted in a form. Double spaces between words look careless in printed documents, and stray tabs can break alignment in code or data files. Trimming them is a small step that prevents a lot of frustration.
This tool removes spaces and tabs from the start and end of every line. You can also collapse runs of several spaces into one, which tidies text copied from PDFs or web pages where layout spacing has leaked into the words. Non-breaking spaces, which often arrive when you copy from websites and word processors, are handled as well, since they look like normal spaces but are treated differently by many programs.
It is worth trimming any data before you import it into another system. Contact lists, product catalogues, survey responses and exam rolls all tend to collect stray spaces when people type them or copy them between apps. Cleaning the text first means sorting, matching and removing duplicates will work as expected. Writers can use it to tidy up drafts before sending them to an editor, and developers can use it to clean configuration values that must match exactly. After trimming, compare the line count with the original to make sure nothing important was removed. Everything runs in your browser, so you can safely clean private records and internal documents.
How to use it
- Paste your text into the input box, or open a file from your device.
- Adjust the options. The result updates instantly.
- Copy the result, or download it as a file where offered.
Questions
What does 'collapse spaces' do?
It replaces runs of two or more spaces inside a line with a single space.
Are non-breaking spaces removed?
Yes. They are converted to normal spaces first, so they are trimmed too.
Last reviewed 16 October 2026.
