Home / Guides

Unicode Space Characters: Tab, Thin, Hair, Em and En Space

Published 2026-10-17

The space bar types one kind of space, but Unicode defines many more: wide ones, thin ones, ones that refuse to break across lines, and one that is as wide as a Chinese character. They all look like a gap, and software treats each as a different character. This guide lists them with their code points, widths and uses, and shows how to find them and turn them back into ordinary spaces.

Space characters compared

CodeNameWidthTypical use
U+0020SpaceSet by the font; stretches in justified textThe normal gap between words
U+0009Tab (character tabulation)Not fixed; jumps to the next tab stopIndentation, columns, tab-separated data
U+00A0No-break space (NBSP)Same as a spaceKeeps two words on one line
U+2002En spaceHalf an emA fixed, wider gap
U+2003Em spaceOne em, the size of the typeParagraph indents, wide separation
U+2004Three-per-em spaceA third of an emFine typesetting
U+2005Four-per-em spaceA quarter of an emFine typesetting
U+2006Six-per-em spaceA sixth of an emFine typesetting
U+2007Figure spaceThe width of a digit; does not breakLining up numbers in columns
U+2008Punctuation spaceThe width of a full stopLining up numbers with punctuation
U+2009Thin spaceAbout a fifth of an emBetween a number and its unit, inside nested quotes
U+200AHair spaceThinner than a thin spaceA sliver of room around dashes and symbols
U+202FNarrow no-break spaceNarrow; does not breakDigit grouping, French punctuation
U+205FMedium mathematical spaceFour eighteenths of an emMathematical formulas
U+3000Ideographic spaceThe width of one Chinese or Japanese characterEast Asian text

An em is a unit equal to the current type size, so in 16-pixel text an em space is 16 pixels wide. The widths in the table are the nominal ones. Fonts are free to differ, and in a monospaced font most of these spaces come out the same width.

The zero-width space, U+200B, is missing from the table on purpose. Despite its name, Unicode classes it as a format character and not as a space. It is covered in our zero-width space guide.

Whitespace characters as software sees them

Unicode has a category called space separators, and it holds 17 characters: the normal space, the no-break space, the eleven characters from U+2000 to U+200A, the narrow no-break space, the medium mathematical space, the ideographic space and the Ogham space mark U+1680. The tab is not among them. It is a control character, in the same group as the line feed and the carriage return.

The wider property that programmers call white space covers those 17 plus the tab, the line-ending controls and the line and paragraph separators, 25 characters in all. This is roughly the set that \s matches in a regular expression in JavaScript or Python, and the set that a trim function removes from the ends of a string. So a trim usually does remove a no-break space or an ideographic space from the ends. What it does not do is turn one in the middle of a string into a normal space, and that is where the problems start.

The spaces you are most likely to meet

Tab

The tab character does not have a width. It tells the display to move to the next tab stop, which is every eight columns in most terminals and whatever you set in an editor or a word processor. That is why a tab-indented file looks different from one program to the next.

Tabs carry meaning in several file formats. Tab-separated files use them between fields. A Makefile requires a tab at the start of each command line. YAML goes the other way and forbids tabs for indentation, and Python refuses a file that mixes tabs and spaces in a way that makes the indentation ambiguous. In HTML a tab is collapsed like any other white space unless the text is preformatted.

Thin space and hair space

These are the typographer's fine adjustments. A thin space is used between a number and its unit, between the thousands groups of a long number, and between a single and a double quote mark that would otherwise touch. The hair space is thinner still and is mostly used to give an em dash or a symbol a little air. In HTML they are   and  .

Em space and en space

Both are fixed-width gaps that do not stretch when a line is justified. The em space is the traditional paragraph indent. Because browsers collapse a run of ordinary spaces into one, people also use   and   in HTML when they want a wider gap that survives.

Narrow no-break space

This one reaches ordinary data more often than you would expect, because software inserts it when formatting numbers. Ask a current browser to format a number for French and it groups the digits with U+202F:

(1234567.89).toLocaleString("fr-FR")   // "1 234 567,89" with U+202F between groups
(1234567.89).toLocaleString("sv-SE")   // the same pattern with U+00A0

A figure formatted this way looks perfect and then fails to parse as a number, or fails to match the same figure typed with normal spaces. The exact character depends on the language and on the version of the browser's language data.

Ideographic space

Chinese and Japanese text is set in a grid of square characters, and the ideographic space fills exactly one square. Japanese input methods type it when the space bar is pressed in full-width mode. It regularly turns up in names, addresses and search queries entered on those keyboards, where it prevents a match with the same text typed using normal spaces.

Figure space

A figure space is as wide as a digit in fonts whose digits share one width. It lets you pad a column of numbers so the digits line up, and it does not allow a line break.

HTML entities for spaces

SpaceEntityNumeric form
No-break space  
En space  
Em space  
Figure space  
Thin space  
Hair space  
Narrow no-break spacenone in common use 
Ideographic spacenone 
Tab		

Why special spaces cause trouble

How to find and replace them

Paste the text into the AI Text Cleaner. Every special space is named in the list of characters found, with its code and a count. With Replace unusual spaces switched on, which is the default, the no-break space, the Ogham space mark, everything from U+2000 to U+200A, the narrow no-break space, the medium mathematical space and the ideographic space each become one normal space.

Tabs are handled separately. A single tab is kept as it is. The option Fix extra spaces collapses any run of two or more spaces or tabs inside a line into one space, and it removes spaces and tabs at the ends of lines. Switch that option off before cleaning tab-separated data: two tabs in a row mark an empty field there, and collapsing them would shift the columns.

In code, a regular expression does the same replacement. In JavaScript:

const clean = text.replace(/[   -    ]/g, " ");

In a spreadsheet, replace one kind at a time with its decimal code, for example the narrow no-break space:

=SUBSTITUTE(A1, UNICHAR(8239), " ")

Quick answers

How many space characters does Unicode have? Seventeen in the space separator category. Counting the tab, the line-ending characters and the separators, 25 characters have the white space property.

Is a tab the same as several spaces? No. A tab is one character, U+0009, and its width on screen depends on the tab stops of the program showing it.

What is the thinnest visible space? The hair space, U+200A. The zero-width space is thinner in the sense that it has no width at all, but it is not classed as a space.

Try it on your own text. Paste text and see which special spaces it contains, then copy it with normal ones. Open the AI Text Cleaner

Related guides