text tool
Remove extra spaces from text
Paste your text and the double spaces, tabs, spaces at line ends and runs of blank lines are cleaned straight away, with a line saying how many of each were fixed. Every rule is a switch, and a second view draws the invisible characters so you can see what was there.
Loading the tool…
- Runs on your device, nothing is uploaded
- Free, no sign in
- No watermark, no file limit
How it works
- 1
Paste your text
Put it in the Your text box. The Cleaned box beside it fills at once, and both show their line and character counts.
- 2
Read what changed
The list under the boxes names each fix and its count, such as 4 runs of spaces shortened or 2 special spaces made normal.
- 3
Switch rules on or off
Ten rules sit under Rules. Seven are on by default; removing indents, removing every blank line and the space before punctuation are off until you tick them.
- 4
Check the hidden characters, then copy
Open Show the hidden characters to see tabs, special spaces and extras marked in your original. Then copy or download the cleaned text.
Where extra spaces come from
Most messy spacing is inherited rather than typed. Text copied from a PDF often carries a space at the end of every line and double spaces where the layout was justified. Email clients and word processors insert non-breaking spaces to stop a line wrapping between two words, and they travel with the text when you paste it elsewhere. Spreadsheets and code editors bring tabs. Web pages contribute zero width spaces and byte order marks that are invisible on screen but still count as characters, still break a search for the words either side, and can make two lines that look identical fail to match.
Why each rule is a switch
Spacing that is wrong in one place is right in another. Indentation is noise in a pasted paragraph and meaning in a list or a poem, so removing spaces at the start of lines is off by default. A space before a question mark is a typo in English and the rule in French, so that fix is off too. One blank line between paragraphs is structure, while four in a row is usually a leftover, so runs are shortened to one rather than removed; a separate rule removes every blank line when you want one block. The rules run in a fixed order, special spaces first, so a non-breaking space next to a normal one becomes a double space and then a single one.
Seeing the characters you cannot see
A normal text box shows a tab, a non-breaking space and a normal space as the same gap, and a zero width space as nothing at all. Open Show the hidden characters and your original text is redrawn with marks: an arrow for each tab, a degree sign on a tinted background for each special space, a broken bar for each zero width character, and a dot for every space that sits in a run or at the start or end of a line. Single spaces between words are left plain, so the marks point only at what a rule would change.
Clean text before it goes anywhere else
Spacing problems multiply when text moves on. Double spaces make a justified paragraph look patchy, trailing spaces make two identical options in a dropdown list count as different, and an invisible character in a heading can break a table of contents link. Character limits count every one of these too: the document, form and presentation generators each take a prompt of up to 10,000 characters, and invisible padding uses that budget for nothing. Cleaning first means the length you see is the length that counts.
Limits worth knowing
Converting non-breaking spaces is the one rule that can change meaning, because some of them were put there on purpose, between a number and its unit or inside a name. If your text came from a carefully set document, switch that rule off and fix the rest. Tabs become one space, which is right for prose and wrong for tab separated columns. Nothing is uploaded and nothing is stored, ever.
Limits
- Non-breaking spaces are converted to normal spaces when that rule is on, which changes copy that relied on them, such as 10 km or a name kept on one line. Switch the rule off to keep them.
- Tabs become a single space, so columns lined up with tabs collapse. Switch the tab rule off for tab separated data.
- The hidden character view draws the first 50,000 characters. The cleaning covers the whole text.
What it does not do
- It does not join lines broken in the middle of a sentence; that is a separate job from spacing.
- It does not fix spelling, punctuation or capital letters, apart from the optional rule for a space before punctuation.
- It does not touch the joiner characters that build emoji and some scripts, only zero width spaces and byte order marks.
- It does not upload or store your text.
Questions people ask
Why does my text still look spaced out after I remove double spaces?
The gaps may not be spaces. Justified text from a PDF can arrive with tabs or with special spaces such as the em space, which a normal double space rule ignores. Open Show the hidden characters: an arrow marks a tab and a degree sign marks a special space. With the first three rules on, both are turned into normal spaces before the runs are shortened.
What is a non-breaking space?
It is a space that stops a line from wrapping at that point, so 10 km or Mr Smith stays together at the end of a line. Word processors add them automatically in some places, and they look exactly like a normal space. Search and replace tools often miss them, which is why a double space that includes one survives an ordinary cleanup.
How do I remove all line breaks, not just blank lines?
This tool keeps line breaks, because it deals with spacing rather than structure. Remove every blank line closes the gaps between paragraphs, but each line stays a line. To join lines that a PDF broke mid sentence, use a line break remover, or turn on regex in the find and replace tool and replace a single \n with a space.
Can trailing spaces cause problems in forms and spreadsheets?
Yes. A trailing space makes Sydney and Sydney followed by a space two different values, so duplicate detection, lookups and dropdown option matching can fail even though the cells look the same. Pasting a list of options with trailing spaces into a form builder creates options that look identical but are not. Cleaning the list first removes the problem before it reaches the data.
What is a zero width space and how did it get into my text?
It is a character that takes no room on screen. Web pages use it to suggest where a long word or address may wrap, and some editors and chat apps add it around links and mentions. It is invisible, but it still counts as a character, breaks a search for the words either side of it, and can stop a pasted code or address from working.
Paste the clean text into a document
Take what you made here into documents.
Create a document with OneCraftMore tools like this
- Find and replace onlineFind and replace online with plain text or JavaScript regex. Every match is highlighted and counted, and capture groups like $1 work in the replacement.
- HTML to text converterAn HTML to text converter that keeps headings, list items and table rows on their own lines, and drops scripts, styles and hidden elements.
- Markdown table generatorA Markdown table generator: type into a grid or paste CSV or spreadsheet cells, set each column's alignment, and copy a padded GitHub flavoured table.
- Number to words converterA number to words converter for cheques, invoices and contracts: dollars and cents or pounds and pence in English words, with the figures alongside.
- Case converterSee sentence case, title case, camelCase, snake_case and eleven more rendered from your own text, then press the one you want to copy it. Runs in your browser.
- Word counterCount words, characters, sentences and paragraphs as you type, and see which sentences are hard work. Runs in your browser, nothing is uploaded or stored.
Written and checked by the OneCraft team. Last checked .