Map Extract
Free tool

Remove extra and invisible spaces

Paste text with messy spacing and get it back with single spaces between words, nothing dangling at the ends of lines and no hidden non-breaking spaces. A stray space before a comma or full stop is closed up too.

Runs in your browser. Nothing you enter is uploaded.

Example: a business name and address copied from a directory

A sales person copies a café's details from an online directory into her prospect sheet. On screen it looks fine, but the name holds a double space and a non-breaking space, the second line starts with a tab and the comma has a space in front of it.

With all three options on, the result is two clean lines. The non-breaking space after Café is the kind of thing nobody can see, and the one most likely to stop a match against the same business found elsewhere.

Input
Harbour  Café[non-breaking space] Ltd   
[tab] 4  Pier Road ,  Whitby
Result
Harbour Café Ltd
4 Pier Road, Whitby

Cleaning the spacing

  1. Paste the text

    A single value, a column from a spreadsheet or a whole document. Example buttons load text pasted from Word, spaces at line ends, and tabs mixed with spaces.

  2. Check the three options

    All three switches start ticked: tabs become spaces, each line is trimmed and non-breaking spaces are swapped for normal ones. Untick the tab switch if tabs separate columns you want to keep.

  3. Copy the cleaned text

    Runs of spaces always become one, and a space before , . ; : ! or ? is always removed. Line breaks are kept.

What counts as an invisible space

Web pages often use a non-breaking space to stop two words being split across lines, for example between a number and its unit. It looks like a space but is a different character, so a search for the normal space will not find it. The replace option also handles the narrow and figure spaces used in some prices and the zero-width space, which is removed outright.

Spaces inside a line break, such as a blank line, are left for the empty lines tool. If you want everything on one line, run remove line breaks afterwards.

Questions people ask

How do I get rid of double spaces in text?

Paste it here. Wherever two, three or more spaces sit together they are squashed to one, and anything hanging off either end of a line is trimmed away. In Word, Find and Replace does the same if you search for two spaces, replace with one and repeat until nothing is found.

Is this the same as Excel's TRIM function?

Close. TRIM removes outer spaces and reduces inner runs of spaces to one, but it does not touch non-breaking spaces, which are common in data copied from websites. This tool replaces those as well, and also closes up a space before punctuation.

Will it remove the line breaks too?

No. Each line keeps its place; only the spaces and tabs within lines change. If you need a single paragraph, use the remove line breaks tool next. If blank lines are the problem, the remove empty lines tool handles those.

Where your data goes

Spaces are normalised in the page without a server round trip. Names, addresses and notes you paste are not collected.

Checked against the tool on

Top