Illustration of a row of labelled blocks of different widths representing different space characters

Text & writing

Spaces, Tabs, and Non-Breaking Spaces Explained

Several different characters can produce blank space in text, and they behave differently. Knowing which one you have explains why text wraps where it does, why columns do not line up, and why some “spaces” are not removed by a simple find and replace.

Ready to try the tool this guide describes?

The main space characters

The main space characters comparison
CharacterCode pointWhat it does
SpaceU+0020The ordinary space between words; a line can wrap here.
TabU+0009Moves to the next tab stop, so its width varies.
Non-breaking spaceU+00A0Looks like a space but keeps the words on either side on the same line.
Narrow no-break spaceU+202FA thinner non-breaking space used in some typographic conventions.
En space and em spaceU+2002, U+2003Fixed-width spaces as wide as an en or an em.
Zero-width spaceU+200BTakes up no width; marks a possible line-break point.

Non-breaking spaces

A non-breaking space prevents a line break between two words, which keeps things like “10 kg” or “Mr. Smith” together. In HTML it is written  . Because it is a different character from an ordinary space, a find-and-replace for spaces will not change it, and text that contains it may not match text that uses normal spaces.

Tabs

A tab jumps to the next tab stop, so its visible width depends on the program and its settings. Text aligned with tabs in one program can be misaligned in another. For real alignment, use a table instead.

Seeing what you have

Most word processors and code editors can show whitespace characters, usually as dots, arrows, and degree-like symbols for non-breaking spaces. Turning this on is the quickest way to understand spacing problems in a document.

Spaces, Tabs, and Non-Breaking Spaces FAQ

What is a non-breaking space?
A space character (U+00A0) that prevents a line break between the words on either side of it.
Why doesn’t find-and-replace remove some spaces?
They are probably non-breaking spaces or other space characters, which are different from the ordinary space you searched for.
Is a tab the same as several spaces?
No. A tab is one character that moves to the next tab stop, so its width depends on the program.
What is a zero-width space?
A character (U+200B) that takes up no width and marks where a line may break. It is invisible, which can make text that looks identical compare as different.
How do I write a non-breaking space in HTML?
With the entity  .

Related guides

Open the tool

Jump into Remove Extra Spaces when you are ready to process your files.

← Back to all guides

More from Looty

Explore Looty’s Ecosystem

Discover more ways Looty can help you learn, organize, create, and make an impact.