Non-breaking space
Also known as: No-break space, NBSP, , U+00A0, Narrow no-break space, NNBSP, U+202F
A non-breaking space (U+00A0, written in HTML) looks like an ordinary space but stops a line from breaking at that point. Its narrower sibling, the narrow no-break space U+202F, does the same at about half the width. Both turn up uninvited in text copied from documents, web pages and formatted numbers, where they break searches and comparisons.
Overview
Unicode has many spaces besides the ordinary U+0020. The no-break space, U+00A0, is as wide as a normal space but glues the words on either side together, so 10 kg or Mr Smith never splits across two lines. The narrow no-break space, U+202F, is thinner. French typography uses it before ; ! and ? and inside « », and CLDR, the locale data most software formats numbers with, uses it to group digits in French: Intl.NumberFormat("fr-FR") formats 1234567.5 as 1 234 567,5 with two U+202F characters. The figure space, U+2007, is as wide as a digit and keeps columns of numbers aligned. In HTML, is also the one space that survives whitespace collapsing, which is why pages use it for spacing and copied text carries it along.
Most unexpected no-break spaces have mundane sources. Microsoft Word inserts them before : ; ? and ! when the proofing language is French and automatic smart quotes are on. Java 20 and later, using CLDR 42 data, puts U+202F before AM and PM when it formats English times, and Chrome and Node.js briefly did the same in early 2023 before reverting it for compatibility. In April 2025 people found U+202F in long answers from OpenAI's o3 and o4-mini models; OpenAI said it was a quirk of training, not a watermark.
They cause bugs because they look identical to a space but are different characters. 1 000 written with a no-break space doesn't equal 1 000 written with an ordinary one, searching a document for the phrase finds nothing, and a parser expecting U+0020 rejects the input: the Java change broke code that parsed English times typed with an ordinary space, until JDK 23 made parsing accept either. Languages also disagree on whether these count as whitespace. JavaScript's \s, trim() and Python's str.split() treat both as whitespace, while Java's \s matches only ASCII whitespace unless it is told otherwise. Unicode NFKC normalization turns both into a plain space.
This site's zero-width decoder marks every unusual space, separately from truly invisible characters, and gives a cleaned copy with them turned back into ordinary spaces. In code, replacing /[\u00A0\u202F\u2007]/g with a space handles the three common ones.