MailSlurp logo

blog

NBSP Character Explained: How To Use Non-Breaking Spaces in HTML and Email

Learn what the NBSP character means, how ` ` works in HTML, when to use non-breaking spaces, how it differs from normal spaces, and how to debug formatting problems in web pages and email templates.

If you searched for nbsp, non breaking space, or  , the short answer is simple: it is a space character that prevents a line break between the words or symbols around it.

The practical part is where teams get into trouble. In HTML and email templates,   can prevent ugly wrapping in prices, IDs, OTP labels, and timestamps, but it can also create mysterious spacing bugs when it is copied in by accident or used as a layout hack.

Use this page for the quick NBSP meaning. Use NBSP HTML entities for the full entity reference and NBSP in HTML emails for email-template QA.

Quick answer

  • NBSP means non-breaking space
  • HTML entity:  
  • decimal entity:  
  • hexadecimal entity:  
  • Unicode code point: U+00A0

Its purpose is simple: keep nearby text on the same line.

What does NBSP do?

A normal space allows text to wrap when the browser or email client needs to break a line.

A non-breaking space tells the renderer:

  • keep these tokens together
  • do not wrap at this space

That is useful for text like:

  • Order #4821
  • USD 49.00
  • Mon 10:00
  • OTP code
  • v2.4 beta

How to write a non-breaking space

In HTML

Use the named entity:

Price: USD 49.00

In numeric entity form

You can also write:

Price: USD 49.00 Price: USD 49.00

As a literal character

Some editors insert the actual Unicode NBSP character directly. That works, but it is harder to spot during debugging, so the explicit HTML entity is usually easier to maintain.

When to use  

Use it when two nearby tokens look wrong if they split across lines.

Good cases:

  • currency with amount
  • date labels
  • order and booking references
  • title plus surname
  • OTP and MFA labels
  • short version numbers or product names

Example:

Your OTP&nbsp;code is <strong>482193</strong>

When not to use &nbsp;

Do not use NBSP as a layout system.

Avoid using it for:

  • indenting paragraphs
  • spacing buttons apart
  • faking columns
  • creating wide visual gaps
  • forcing long sentences to stay together

If spacing only works because of repeated &nbsp;, the real problem is usually your layout, CSS, or email table structure.

Why NBSP matters in email templates

Email clients are far less predictable than modern browsers. Wrap behavior, font rendering, and spacing all vary.

That makes NBSP useful for:

  • OTP and verification emails
  • invoices and receipt lines
  • booking references
  • shipping notifications
  • narrow mobile layouts where labels wrap aggressively

In those cases, keeping the right tokens together can make the message much easier to read.

Common NBSP examples

Prices

Total: USD&nbsp;49.00

Order IDs

Reference: Order&nbsp;#A-1024

Dates and times

Pickup: Mon&nbsp;10:00

Labels in emails

Your OTP&nbsp;code is 482193

NBSP versus a regular space

Character What it does Can line break here?
regular space normal word separation yes
&nbsp; non-breaking word separation no

That one behavior difference is why NBSP is so useful for prices, labels, and short paired values.

NBSP versus &ensp; and &emsp;

These are not interchangeable.

Entity Purpose Breaks line?
&nbsp; keep items together no
&ensp; wider fixed space yes
&emsp; even wider fixed space yes

For HTML email and most product UI, &nbsp; is the most practical one. Wider spacing entities usually create more rendering variance than value.

Common NBSP problems

Hidden non-breaking spaces from copy and paste

Rich-text editors, spreadsheets, and CMS tools often insert NBSP characters invisibly.

Symptoms:

  • unexpected wrapping
  • search and replace misses the issue
  • text looks normal in the editor but renders strangely

Double encoding

If &nbsp; is escaped again, it becomes literal text:

&amp;nbsp;

That renders the entity string instead of a space.

Overuse in paragraphs

Too many NBSPs cause awkward line breaks and uneven spacing, especially on mobile.

Using NBSP instead of fixing the layout

If you are relying on repeated non-breaking spaces for alignment, the structure is probably the real problem.

How to debug NBSP issues

When spacing looks wrong:

  1. inspect the raw HTML for &nbsp;, &#160;, or \u00A0
  2. replace suspect spaces with normal spaces and compare the result
  3. test the message in a browser and at least one email client
  4. keep only the NBSPs that protect an intentional token pair

For email templates, add one more step: test the received message. A local HTML file can look fine while the final email changes after a template engine, ESP, sanitizer, or email client processes it.

Safe rule of thumb

Use NBSP only when:

  • the tokens are short
  • the meaning is clearer when they stay together
  • wrapping would make the content look broken or ambiguous

Good:

  • USD&nbsp;49.00
  • Order&nbsp;#4821
  • OTP&nbsp;code

Bad:

  • entire marketing sentences
  • spacing between buttons
  • fake alignment in long paragraphs

How MailSlurp helps

MailSlurp helps teams test HTML email output before small spacing bugs reach customers.

Useful routes:

That means you can verify formatting in a real workflow instead of guessing from a local editor preview.

FAQ

What does NBSP mean?

NBSP means non-breaking space.

What is &nbsp; in HTML?

&nbsp; is the HTML entity for a non-breaking space.

Is NBSP the same as a normal space?

No. A normal space allows a line break. NBSP does not.

When should I use a non-breaking space?

Use it when two nearby tokens like a price, label, or ID should stay on the same line.

Why does copied text sometimes contain weird spacing?

Because some editors insert hidden non-breaking spaces that look like normal spaces until rendering exposes them.

How do I find accidental NBSP in email HTML?

Search the raw HTML for &nbsp;, &#160;, &#xA0;, and \u00A0. Then send the template to a test inbox and confirm the received version does not contain accidental &amp;nbsp; or long non-wrapping text.

Can MailSlurp preview NBSP rendering?

Yes. Send the final email to MailSlurp, then use free email render or device previews to inspect the received message across supported client and device contexts.

Final take

NBSP is not a styling system. It is a precision formatting tool. Used carefully, it protects the small pieces of text that should stay together. Used carelessly, it creates subtle layout bugs that are harder to notice than to explain.