Remove Spaces
Remove extra spaces, every space, the spaces at the start and end of lines, or empty lines.
Runs in your browser. Nothing you enter is uploaded.
How to use Remove Spaces
- Paste your text into the box.
- Choose Extra spaces to turn runs of spaces into one and trim each line, All spaces to remove every space, Spaces at line ends to trim lines only, or Empty lines to delete blank lines and leave the rest as it is.
- Under Options, choose whether tabs and no-break spaces count, and whether to remove empty lines.
- Copy the result, or download it as a .txt file.
Examples
Double spaces and messy line ends
- Remove: Extra spaces
Please send the report by Friday. Thanks!
Please send the report by Friday. Thanks!
Runs of spaces become one, and the spaces and tab at the start and end of each line are gone.
An account number with spaces
- Remove: All spaces
- Remove line breaks too: Off
DE89 3704 0044 0532 0130 00
DE89370400440532013000
Every space is removed, for forms that only accept the digits and letters.
Text copied from a web page
- Remove: Extra spaces
Price:NBSP$25NBSPNBSP perNBSPmonth
Price: $25 per month
The no-break spaces look like normal spaces, so many tools miss them. Here they count as spaces.
Blank lines between every line
- Remove: Empty lines
Unplug the router. Wait 30 seconds. Plug it back in. Wait for the lights.
Unplug the router. Wait 30 seconds. Plug it back in. Wait for the lights.
The blank lines go, including the one with only spaces. Every other line stays exactly as it was, indent included.
How it works
Choose what to remove:
| Remove | What happens | “··a···b··” becomes |
|---|---|---|
| Extra spaces | Runs of spaces become one space, and each line is trimmed | “a b” |
| All spaces | Every space goes; line breaks stay unless you turn on Remove line breaks too | “ab” |
| Spaces at line ends | Only the spaces at the start and end of each line go | “a···b” |
| Empty lines | Blank lines go, and every other line stays exactly as it is | “··a···b··” |
In the table, each · stands for one space.
Good to know
- Tabs count as spaces, so a tab between words becomes one space. Turn off Include tabs to keep them, for example in data copied from a spreadsheet.
- No-break spaces look exactly like normal spaces. They come from web pages, Word and some PDFs, and Excel’s TRIM doesn’t remove them. They’re treated as spaces here, and the tool says how many it found.
- Zero-width spaces are invisible characters, not spaces, so they stay. The Invisible Character Remover finds and removes them.
- Empty lines: to remove only blank lines, choose Empty lines. To remove them while cleaning spaces, turn on Remove empty lines in the other modes. A line with only spaces or tabs counts as empty.
- Line breaks are kept in every mode except All spaces with Remove line breaks too, which makes the result one line.
Nothing you paste is uploaded. The tool runs in your browser.
Questions
How do I remove spaces in Excel?
=TRIM(A1) removes spaces at the start and end and turns double spaces into one. =SUBSTITUTE(A1," ","") removes every space. TRIM leaves no-break spaces from web pages alone, so use =TRIM(SUBSTITUTE(A1,CHAR(160)," ")) for text copied from a website.
How do I remove extra spaces in Google Sheets?
Select the cells and choose Data → Data cleanup → Trim whitespace, or use =TRIM(A1). To remove every space, use =SUBSTITUTE(A1," ","").
How do I remove double spaces in Word?
Press Ctrl+H, type two spaces in Find what and one space in Replace with, then choose Replace All until Word finds nothing. Or click More, tick Use wildcards, and replace " {2,}" (a space followed by {2,}) with one space in a single pass.
How do I remove empty lines from text?
Paste the text and choose Empty lines. Every blank line goes, including lines that hold only spaces or tabs, and the other lines stay exactly as they are. In Notepad++, use Edit → Line Operations → Remove Empty Lines (Containing Blank characters).
Why are some spaces not removed?
Text from web pages and Word often has no-break spaces. They look like normal spaces but are a different character, so Excel’s TRIM and many tools skip them. This tool removes them too while Include no-break spaces is on. Zero-width spaces are invisible and aren’t spaces at all; use the Invisible Character Remover for those.
Related tools
- Remove Line Breaks Fix text copied from PDFs and emails that breaks mid-sentence.
- Invisible Character Remover Find and remove zero-width spaces and other hidden characters.
- Remove Duplicate Lines Delete repeated lines from a list, or find the duplicates.
- Word & Character Counter Count words and characters, and check limits for X, Instagram and more.
- Alphabetizer Sort a list A to Z, Z to A or by length.
- Binary Translator Translate binary to text and text to binary, emoji included.
Updated October 26, 2026 · Works in current Chrome, Edge, Firefox and Safari · Runs entirely in your browser