TextArray
100% local

Remove extra spaces

Collapse repeated spaces and tabs and trim messy whitespace from text.

Input
Output

Remove extra spaces

Paste any text and this tool tidies its whitespace in one pass: runs of spaces and tabs collapse into a single space, leading and trailing whitespace disappears from every line, and invisible special characters such as non-breaking spaces turn into regular ones. It is the quickest fix for text copied from PDFs, websites, Word documents or spreadsheet cells, where double spaces and stray tabs pile up unnoticed.

Each cleanup step is a separate option, so you stay in control. "Collapse multiple spaces" merges any run of spaces or tabs into one space. "Trim line ends" removes whitespace at the start and end of each line — useful for indented email replies or code comments. "Normalize special spaces" converts non-breaking spaces, thin spaces and other Unicode space characters into ordinary spaces, which fixes the classic problem of find-and-replace not matching text that looks identical. Turn on "Collapse blank lines" to also squeeze several empty lines between paragraphs down to a single one.

The tally under the output shows how many characters came in, how many remain and how many were removed, so you can see at a glance whether the text actually contained hidden whitespace. Windows and Unix line endings are both handled, and even long documents are processed in milliseconds.

Everything runs locally in your browser. Your text is never uploaded to any server, so it is safe to clean up confidential contracts, internal reports or unpublished drafts. Copy the result or download it as a .txt file when you are done.

FAQ

What counts as an extra space?
Any run of two or more spaces or tabs inside a line, plus whitespace at the start or end of a line when trimming is on. Each rule has its own toggle.
What are special spaces and why normalize them?
Non-breaking spaces and other Unicode space characters look like normal spaces but behave differently — search, comparison and layout can all break on them. Normalizing replaces them with regular spaces.
Does it change my line breaks?
No. Line breaks are preserved unless you enable "Collapse blank lines", which reduces runs of empty lines to a single one.
Can I remove empty lines completely?
This tool only collapses them. Use the remove empty lines tool to delete blank lines entirely.
Is my text uploaded anywhere?
No. The tool runs entirely in your browser and your text never leaves your device.