Clean Text · browser-local
Remove Extra Spaces
Clean doubled spaces, pasted tabs, and uneven indentation inside ordinary prose. Each line is processed separately so meaningful line breaks remain visible.
Works on up to 5,000 characters and 20,000 code points per field (at most 64 code points per character), processed in your browser.
Output
This text has uneven spacing.
Good fit
Use this tool when
- Copied prose contains doubled or tab-sized gaps.
- You want consistent single spaces within each line.
- Line breaks should remain intact.
Keep the original
Avoid it when
- Spacing aligns plain-text tables or code.
- Tabs encode nesting or indentation.
- Whitespace is significant to a file format.
Reviewed truth vectors
Examples that expose the edge cases
one twoone twoRepeated spaces collapse to one.
a ba bTabs become a single space.
A
B A
BEach line is trimmed independently.
Transparent implementation
How it works
- 01
Normalize line endings.
- 02
Collapse horizontal whitespace within each line.
- 03
Trim the start and end of every line while keeping the breaks.
Known limitations
What the result cannot promise
Intentional indentation is removed.
Non-breaking spaces may require a separate Unicode inspection.
The tool does not rewrite punctuation or grammar.
Questions before copying
Frequently asked questions
Are new lines preserved?
Yes. The default action processes each line independently.
Does it remove tabs?
Runs of tabs and ordinary horizontal spaces become one normal space.
Can it clean a code block?
It can, but should not—indentation is meaningful in many languages.
Testing and sources
How this tool is tested
Automated evidence
- Tool-contract & coverage suiteShared suite · 37 cases across all tools it covers
tests/tools-30.test.mjs mirrors the ToolRunner dispatch and asserts every registered engineId returns the contracted output shape, plus a coverage guard: every style keeps one output character per input character with unmapped characters passed through in place, and strikethrough, zalgo and upside-down never drop or split a grapheme cluster.
Run in: node --test after a production build (vinext build) - Rendered-HTML suiteShared suite · 26 cases across all tools it covers
tests/rendered-html.test.mjs renders the deployed server bundle and asserts the Unicode-version manifest and each wave's tool markup are present in the server-rendered HTML.
Run in: node --test against the built dist/server bundle - Transform & cleanup suiteShared suite · 38 cases across all tools it covers
tests/transform-cleanup.test.mjs exercises each deterministic cleanup and transform action against whitespace, duplicate, ordering, casing, and HTML-to-text edge cases.
Run in: node --test, no network, no randomness
Standards this tool follows
- UAX #29: Unicode Text Segmentation
Grapheme and word boundaries underpinning line and whitespace operations.
- UAX #14: Unicode Line Breaking Algorithm
Line-break semantics behind hard-wrap repair.