Remove Extra Spaces, Tabs and Blank Lines Online
A free tool by DeepRit, a Google Ads agency that does PPC and nothing else. We build and run Google Ads accounts so every click is accounted for. Book a free audit call
Free tool to remove extra spaces, double spaces, tabs, hidden characters and extra blank lines from pasted text, without changing your words.
Free, no sign-up. Runs in your browser: nothing you type is uploaded or saved.
How to remove extra spaces
Paste your text into the box. The tool removes extra spaces instantly and shows the cleaned text below, with a count of how many characters it took out. By default it:
- turns two or more spaces in a row into one space,
- removes spaces at the start and end of every line,
- replaces non-breaking spaces and other unusual space characters with normal spaces,
- deletes invisible zero-width characters,
- removes spaces before punctuation, so "Hello , world" becomes "Hello, world",
- reduces three or more blank lines in a row to a single blank line.
Your words, line breaks and single blank lines between paragraphs are left alone.
Options let you go further: turn tabs into spaces (on by default), remove all blank lines, straighten curly quotes into plain ones, and switch off the punctuation clean-up if you need spaces before punctuation (French typography, for example, puts a space before "?" and "!").
Everything happens in your browser, and nothing you paste is uploaded.
Where extra spaces come from
Extra spaces are rarely typed on purpose. They creep in when text moves between programs:
- Copying from PDFs often adds spaces between words where the original used justified text, plus line breaks mid-sentence. For the line breaks, use remove line breaks.
- Copying from websites brings non-breaking spaces (used to stop words wrapping) and sometimes zero-width characters.
- Old typing habits: many people learned to put two spaces after a full stop. Most modern style guides use one.
- Word processors and email can add tabs, indents and trailing spaces at the ends of lines.
- Spreadsheets and databases often store padded values, such as names followed by several spaces.
- Merging documents from several people with different habits.
Why it's worth cleaning them up
Text looks sloppy
Double spaces in a web page, a social post or an email look careless, and on justified text they create visible gaps. Readers may not know why something looks off, but they notice.
Search and matching fail
"Crumb & Co." and "Crumb & Co." (with two spaces) are different strings to a computer. Extra or invisible spaces cause duplicate records, failed lookups, and search that can't find things. If a list won't deduplicate properly, invisible spaces are usually why. Clean it first, then use remove duplicate lines.
Character counts are wrong
Every space counts towards a character limit. A caption that looks like it fits may be several characters over because of trailing spaces and double spaces. Clean the text, then check it with the character counter.
Hidden characters break things
Zero-width spaces and similar characters are invisible but real. They can break links, passwords, codes, CSV imports and code. Removing them prevents problems that are very hard to spot by eye.
What each clean-up does
Collapsing multiple spaces
Any run of two or more spaces inside a line becomes one space. "We bake daily" becomes "We bake daily". Single spaces are never removed, so your words never run together.
Trimming lines
Spaces and tabs at the start and end of each line are removed. This also removes indentation, so if you need to keep indents (in code or poetry, for example), clean that text a different way.
Non-breaking and special spaces
Text can contain more than a dozen kinds of space character: non-breaking spaces, thin spaces, en and em spaces, the narrow no-break space and the ideographic space used in East Asian text. They look like normal spaces but behave differently. The tool converts them all to ordinary spaces so they can be cleaned like the rest.
Zero-width characters
The zero-width space, zero-width joiner, zero-width non-joiner, word joiner and byte order mark are removed. These characters are invisible and almost never wanted in pasted text. One exception: some emoji sequences and some scripts use the zero-width joiner to combine characters. If you're cleaning text with complex emoji or scripts such as Arabic or Indic languages, check the result carefully.
Spaces before punctuation
Spaces directly before a comma, full stop, semicolon, colon, exclamation mark, question mark, percent sign or closing bracket are removed. "Prices from $9 , delivered daily ." becomes "Prices from $9, delivered daily.". Turn this off for French text, which traditionally uses a space before ";", ":", "!" and "?".
Blank lines
By default, three or more blank lines are reduced to one, which keeps your paragraphs but removes big gaps. Tick "Remove all blank lines" to delete every empty line, useful for lists and data.
Straightening quotes
Curly quotes (" " ' ') are typographically correct for most published text, but they can cause problems in code, CSV files, some forms and older systems. Tick "Straighten curly quotes" to convert them to straight quotes (" and '). Leave it off for normal writing.
When to remove extra spaces
Make it a habit at the moments when text changes hands:
- Before you publish. Remove extra spaces from blog posts, product descriptions and web pages pasted in from documents, so the page looks clean on every screen.
- Before you post on social media. Captions copied from notes apps often carry trailing spaces and double spaces that eat into character limits.
- Before you import data. Remove extra spaces from names, emails and product codes before importing them into a CRM, shop or email tool, so records match and duplicates are caught.
- Before you send a document for translation or review. Clean text is easier to work with and counts correctly when translators quote by word or character.
- Before you compare two versions. Spacing differences show up as changes in a comparison. Clean both versions first, or use the "Ignore extra spaces" option in text compare.
Who uses it
Writers tidying drafts, assistants preparing reports, shop owners cleaning product feeds, marketers fixing email copy, and developers cleaning strings before they go into code or a database. Anyone who copies and pastes text all day eventually needs to remove extra spaces, and doing it in one click is quicker than hunting for double spaces by eye.
One space or two after a full stop?
One. Almost every modern style guide, including the Chicago Manual of Style, AP, APA (7th edition) and the UK government's style guide, uses a single space after a full stop. Two spaces were a habit from typewriters, which used fixed-width letters; proportional fonts on computers make the extra space unnecessary. If you or your team still type two, this tool fixes it in one go.
Before and after
| Before | After |
|---|---|
Fresh bread , every morning . |
Fresh bread, every morning. |
Indented line with trailing spaces |
Indented line with trailing spaces |
Crumb & Co. with a non-breaking space |
Crumb & Co. with a normal space |
Price: + tab + $9 |
Price: $9 |
| Four blank lines between paragraphs | One blank line between paragraphs |
Removing extra spaces in other apps
- Microsoft Word: Find and Replace, find two spaces and replace with one; repeat until no matches are found. Or use wildcards: find
( ){2,}and replace with\1. - Google Docs: Find and replace with regular expressions on: find
\s{2,}, replace with a single space. Careful:\salso matches line breaks. - Excel and Google Sheets: the TRIM function removes spaces at the start and end and collapses internal runs to one space. It doesn't remove non-breaking spaces; use SUBSTITUTE(A1, CHAR(160), " ") first.
The online tool does all of this in one step, including the invisible characters most built-in options miss. For other targeted changes, use find and replace.
Clean data in, better writing out
If you're cleaning up text to reuse it, it's often text about your business: menus, price lists, policies, product details.
This tool is free and runs in your browser. If your business also needs more leads or sales, Google Ads is where people search with their wallet out. DeepRit manages Google Ads for small and mid-size businesses, and only Google Ads. We check your account before we ever get on a call, then fix the structure, the keywords, the tracking and the ads, with month-to-month terms and no long contract. Book a free audit call.
Frequently asked questions
How do I remove double spaces from text?
Paste the text into the box. Every run of two or more spaces becomes one space automatically, and the clean text is ready to copy.
Will this tool remove the spaces between my words?
No. Single spaces between words are kept. Only extra spaces, spaces at the ends of lines and spaces before punctuation are removed.
Does it remove invisible characters?
Yes. Non-breaking spaces are turned into normal spaces, and zero-width spaces, joiners and byte order marks are deleted.
Will it keep my paragraphs?
Yes. Line breaks and single blank lines between paragraphs are kept. Only runs of three or more blank lines are reduced, unless you tick "Remove all blank lines".
Can I keep indentation?
Trimming lines removes indentation, so this tool isn't suited to code or indented poems. Use find and replace for targeted changes instead.
Is my text stored?
No. The tool works in your browser to remove extra spaces, and nothing is uploaded or saved.
Free PPC audit
See where your ad budget leaks.
We look at your Google Ads account before the call, then walk you through what we'd fix first, in dollars. No obligation, no hard sell.