Non-Breaking Space U+00A0

Copy the non-breaking space ( , U+00A0). How it differs from a normal space, why it breaks code and searches, and how to find and remove it.

Remove the Non-Breaking Space from your text

Paste your text below. It stays in your browser; nothing is uploaded.

Other hidden characters too? Scan for all of them

Codepoint
U+00A0
Decimal
160
HTML
 
CSS
\00A0
JS
\u00A0
URL
%C2%A0
UTF-8
C2 A0
Category
Space Separator (Zs)
Block
Latin-1 Supplement

The non-breaking space (NBSP, U+00A0) is the best-known invisible character on the web. Developers type it as  ; writers paste it from Word without knowing. It looks exactly like a regular space, but it stops the line from breaking there, so the words on either side stay together.

That makes it useful for typography. It also causes a classic bug: two strings that look identical fail to match because one has non-breaking spaces where the other has regular ones.

Common Uses

  • Keeping words together. Numbers and units (100 km), titles and names (Dr. Smith), and page references (page 7) should not split across lines.
  • Extra whitespace in HTML. Browsers collapse multiple regular spaces into one but keep non-breaking spaces, which made   the classic way to add spacing.
  • Blank usernames. Some platforms accept NBSP in a username, which makes the profile name look blank.
  • French typography. French rules call for a non-breaking space before semicolons, colons, question marks, exclamation marks and some quotation marks, so the punctuation never starts a line.
  • Empty table cells. In HTML, empty table cells may collapse to zero height.   keeps them at their proper height.

How to Type

PlatformMethod
WindowsAlt+0160 on the numeric keypad.
macOSOption+Space (this is the most common way Mac users accidentally insert NBSP).
LinuxCtrl+Shift+U, type 00A0, press Enter.
MobileNo standard keyboard input. Copy from this page.
HTMLType   or   or  .
JavaScriptUse \u00A0 in strings.
CSSUse content: '\00A0'; in pseudo-elements.
LaTeXUse ~ (tilde) for a non-breaking space.

The macOS Trap

Hold Option for a special character, hit Space before letting go, and you get NBSP instead of a space. The code looks right but fails. Many invisible bugs in code written on a Mac start here.

Why NBSP Causes Bugs

Non-breaking space (U+00A0) and regular space (U+0020) are different Unicode characters that look identical. So:

  • String comparison fails. "hello world" === "hello\u00A0world" is false, though both show "hello world" on screen.
  • Search and find/replace miss it. Searching for a space will not find non-breaking spaces.
  • JSON parsing can break. NBSP in a JSON key, or where regular whitespace is expected, can make parsers throw errors.
  • CSS selectors can fail. A class attribute with NBSP instead of a regular space becomes one class name instead of two.
  • Regular expressions differ. \s matches NBSP in some regex flavors but not others.
  • Trimming may not work. Some languages' trim() strips regular spaces but leaves NBSP.

How to Detect NBSP in Code

In JavaScript:

js
// Check if a string contains NBSPtext.includes('\u00A0')
// Replace all NBSP with regular spacestext.replace(/\u00A0/g, ' ')
// Or use the broader approach - replace all Unicode spacestext.replace(/[\u00A0\u2000-\u200A\u202F\u205F\u3000]/g, ' ')

Where NBSP Sneaks Into Your Text

NBSP rarely gets into text on purpose. The usual sources:

  1. Microsoft Word. Word can insert NBSP automatically, for example before colons, question marks and other punctuation in French text.
  2. Google Docs. Text copied out of Google Docs can contain NBSP, especially around formatted or consecutive spaces.
  3. Web pages. HTML that uses   for spacing pastes as real NBSP characters.
  4. macOS Option+Space. The most common accidental source for developers.
  5. AI chatbots. Text copied from ChatGPT and other AI tools can contain NBSP and its narrow cousin U+202F (see below).
  6. CMS rich text editors. WordPress, Contentful and other CMS editors often insert NBSP when you type consecutive spaces or leave empty paragraphs.
  7. PDF text extraction. Text copied from PDFs often has NBSP instead of regular spaces.

The "ChatGPT Watermark": Hidden Spaces in AI Text

In April 2025, the AI-detection startup Rumi reported that ChatGPT's newer models (o3 and o4-mini at the time) were inserting narrow no-break spaces (U+202F), mostly into longer outputs. The finding spread as a "ChatGPT watermark" for catching AI-written essays.

OpenAI told Rumi the characters were not a deliberate watermark but "a quirk of large-scale reinforcement learning." NNBSP is also legitimate typography, for example in French, so its presence alone proves nothing. Either way, these spaces break string matching, validation and diffs just like a regular NBSP. Before you paste AI output into code, spreadsheets or CMS fields, run it through the Invisible Character Viewer: it shows every U+00A0 and U+202F and strips them in one click.

NBSP vs Other Space Characters

CharacterWidthPrevents line break?Common name
Space (U+0020)NormalNoRegular space
Non-Breaking Space (U+00A0)NormalYesNBSP,  
Narrow No-Break Space (U+202F)NarrowYesNNBSP
En Space (U+2002)Half emNoEn space
Em Space (U+2003)Full emNoEm space
Thin Space (U+2009)Thin (~1/5 em)NoThin space
Hair Space (U+200A)Very thinNoHair space
Zero-Width Space (U+200B)ZeroNo (allows break)ZWSP

Mixing these up causes different bugs. See the Zero-Width Space (zero width, allows line breaks, the opposite of NBSP), the Word Joiner (U+2060, prevents line breaks like NBSP but with no width) and the Em Space (the width of the letter M). Narrow No-Break Space (U+202F) is the thinner NBSP used in French typography and the character behind the "ChatGPT watermark" story.

For Web Developers

Before you reach for  , check whether CSS does the job better:

  • Layout spacing: use CSS margin or padding.
  • Keeping words together:   works, or put CSS white-space: nowrap on a wrapping element.
  • Empty table cells: use CSS empty-cells: show.

Using   for visual layout is a code smell. Reserve it for keeping words together.

Frequently Asked Questions

What is the difference between a regular space and a non-breaking space?

A regular space (U+0020) lets the browser or app break the line at that point. A non-breaking space (U+00A0) looks the same but blocks the line break, so the words on either side stay together on one line.

What does   mean in HTML?

  is the HTML entity for the non-breaking space (U+00A0). It is often used to add extra whitespace, because browsers collapse multiple regular spaces into one but keep non-breaking spaces.

Why are there non-breaking spaces in my copied text?

Word processors like Microsoft Word and Google Docs can insert non-breaking spaces while formatting, and they come along invisibly when you copy and paste. Paste your text into our Invisible Character Viewer to find and remove them.

How do I type a non-breaking space on Mac?

Press Option+Space on macOS to type a non-breaking space. This works in most applications including text editors, browsers, and word processors.

Can non-breaking space cause bugs in code?

Yes. A non-breaking space looks like a regular space but is a different character (U+00A0 vs U+0020). It silently breaks string comparison, search, JSON parsing, CSS selectors and variable names, making it one of the most common invisible bugs in web development.

Does ChatGPT put hidden spaces in its text?

Sometimes. In April 2025, the AI-detection startup Rumi reported that OpenAI's o3 and o4-mini models were inserting narrow no-break spaces (U+202F), a thinner cousin of the non-breaking space, mostly into longer outputs. OpenAI said it was not a watermark but a quirk of large-scale reinforcement learning. Paste your text into our Invisible Character Viewer to find and strip them.

Related Characters

Need to find every hidden character in your text, not just the Non-Breaking Space?

Open the viewer