Remove Extra Spaces
Collapse repeated spaces and trim each line. Type or paste below — the result updates as you type.
Input
Convert to
Output
Private by design
This conversion runs entirely in your browser. Your text is not sent to a server.
Tip
Reverse, sort, and line numbers keep every line. Unique lines keep the first copy. Extra spaces collapse runs of spaces and tabs.
How to convert with Remove Extra Spaces
Paste or type text in the input box.
Watch the result update instantly — nothing is uploaded.
Use the options on this page, or Convert to to open another cleanup tool with the same text.
Copy the result, or use it as the next input.
When should you use it?
Reverse
Flip a string, reverse line order, or reverse letters on each line.
Sort
Put a list in A–Z or Z–A order without a spreadsheet.
Line numbers
Add 1, I, or A markers, or strip them from a pasted draft.
Cleanup
Drop duplicate lines and collapse extra spaces in one pass.
Your text stays private.
These cleanup tools run entirely in your browser. Lists, notes, and drafts are never uploaded.
About cleaning text in the browser
Reverse, sort, line numbers, unique lines, and extra-spaces each have their own URL. Convert to keeps the same persist key so you can switch without re-pasting. Reverse can reverse the whole string, line order, or each line (JavaScript code units, not a full grapheme algorithm). Sort is a simple A–Z or Z–A string sort, not a spreadsheet with locale collation. Unique keeps the first exact copy of each line, including blanks. Extra spaces collapse runs of spaces and tabs per line; newlines stay.
Worked example: banana / apple / banana sorted then uniqued is apple then banana. Line Numberer can add 1, I, i, A, a, or strip numbers. Column sorts and fuzzy unique are out of scope.
Related: Find & Replace for literal or regex edits, Text Diff for two documents, Slugify and case converters for identifiers. Nothing is uploaded. Close the tab to drop the list.
Related text tools
Reverse Text
Reverse an entire string, reverse line order, or reverse each line. The result updates as you type.
Sort Lines
Sort lines alphabetically A–Z or Z–A. Type or paste below — the result updates as you type.
Line Numberer
Add or remove line numbers using 1, I, i, A, or a. The result updates as you type.
Remove Duplicate Lines
Keep the first occurrence of each unique line. Type or paste below — the result updates as you type.
Slugify Text
Turn headlines and phrases into SEO-friendly, URL-safe slugs. Type or paste below — the result updates as you type.
Remove Extra Spaces examples
Extra spaces
Cleanup comparison
| Tool | Example | Typical use |
|---|---|---|
| Reverse | ananab elppa ananab | Puzzles, palindromes, and flipping a block of text |
| Sort | apple banana banana | Lists, tags, and names in alphabetical order |
| Numbers | 1. banana 2. apple 3. banana | Numbered drafts, specs, and pasted logs |
| Unique | banana apple | Keep the first copy of each repeated line |
| Spaces | banana apple banana | Collapse double spaces and trim each line |
Remove Extra Spaces FAQ
Runs of spaces and tabs on a line collapse; typical trim applies per line. Newlines stay, so this is not “make it one line” (use JSON Minifier or a formatter for that).
It targets ordinary spaces and tabs. Odd Unicode spaces may remain — check the output if a CMS still looks padded.
No. Cleanup stays in this tab. Convert to keeps input across reverse, sort, unique, and line numbers.