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
| Platform | Method |
|---|---|
| Windows | Alt+0160 on the numeric keypad. |
| macOS | Option+Space (this is the most common way Mac users accidentally insert NBSP). |
| Linux | Ctrl+Shift+U, type 00A0, press Enter. |
| Mobile | No standard keyboard input. Copy from this page. |
| HTML | Type or   or  . |
| JavaScript | Use \u00A0 in strings. |
| CSS | Use content: '\00A0'; in pseudo-elements. |
| LaTeX | Use ~ (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"isfalse, 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.
\smatches 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:
Where NBSP Sneaks Into Your Text
NBSP rarely gets into text on purpose. The usual sources:
- Microsoft Word. Word can insert NBSP automatically, for example before colons, question marks and other punctuation in French text.
- Google Docs. Text copied out of Google Docs can contain NBSP, especially around formatted or consecutive spaces.
- Web pages. HTML that uses
for spacing pastes as real NBSP characters. - macOS Option+Space. The most common accidental source for developers.
- AI chatbots. Text copied from ChatGPT and other AI tools can contain NBSP and its narrow cousin U+202F (see below).
- CMS rich text editors. WordPress, Contentful and other CMS editors often insert NBSP when you type consecutive spaces or leave empty paragraphs.
- 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
| Character | Width | Prevents line break? | Common name |
|---|---|---|---|
| Space (U+0020) | Normal | No | Regular space |
| Non-Breaking Space (U+00A0) | Normal | Yes | NBSP, |
| Narrow No-Break Space (U+202F) | Narrow | Yes | NNBSP |
| En Space (U+2002) | Half em | No | En space |
| Em Space (U+2003) | Full em | No | Em space |
| Thin Space (U+2009) | Thin (~1/5 em) | No | Thin space |
| Hair Space (U+200A) | Very thin | No | Hair space |
| Zero-Width Space (U+200B) | Zero | No (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
marginorpadding. - Keeping words together:
works, or put CSSwhite-space: nowrapon 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
U+200BWord JoinerU+2060Soft HyphenU+00ADHangul FillerU+3164Braille Pattern BlankU+2800Em SpaceU+2003Need to find every hidden character in your text, not just the Non-Breaking Space?
Open the viewer