Glossary
Plain English
Cross-linked to tools

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.

Common questions about Non-breaking space

What is the difference between a space and a non-breaking space?
They look the same, but a line can wrap at an ordinary space (U+0020) and never at a non-breaking space (U+00A0). It keeps values and units, initials or dates together on one line. To software they are different characters, so text containing one won't match text containing the other.
How do I type a non-breaking space?
On a Mac, press Option and Space. On Windows, hold Alt and type 0160 on the numeric keypad; in Word, Ctrl+Shift+Space works too. In HTML, write   or  . Because the Mac shortcut is so easy to hit by accident, stray no-break spaces are a common cause of errors in code typed on a Mac.
What is U+202F?
U+202F is the narrow no-break space: a thin space that, like U+00A0, prevents a line break. French uses it before ; ! and ? and between groups of digits, and recent Java versions put it before AM and PM in English times. It is a normal typographic character, not an invisible one; it simply looks like a space.
Why does my text comparison fail when both strings look the same?
Usually because one of them contains a no-break space or an invisible character where the other has a plain space. Text copied from Word, PDFs, web pages and formatted numbers often carries U+00A0 or U+202F. Normalizing both strings, or replacing those characters with U+0020 before comparing, fixes it; the zero-width decoder on this site shows where they are.
Is a non-breaking space in ChatGPT output a watermark?
No. OpenAI said the narrow no-break spaces found in some o3 and o4-mini answers in 2025 were a quirk of training, and its text watermark works through word choice and, in its words, does not add hidden characters or invisible spaces. The same characters also come from word processors, web pages and number formatting, so finding one says nothing about who or what wrote a text.

Tools that work with Non-breaking space

Zero-Width Character Detector / Decoder

Reveal invisible zero-width characters in text, decode messages hidden with them, or hide one yourself.

Text Diff

Compare two pieces of text and highlight what changed.

HTML Entity Encoder / Decoder

Encode text to HTML entities and decode them back.

External references