Example 1 — Title and Surname
<p>Mr. Smith</p>
<p>Dr. Jane Doe</p> How It Works
The period after “Mr.” often sits at the end of a line when using a normal space. keeps the honorific glued to the name.

The non-breaking space is a special type of space character used in HTML to prevent automatic line breaks. It helps you keep related words, numbers, or symbols together on the same line so your text stays readable and professional-looking.
Unlike a regular space, which the browser may collapse or use as a wrap point, forces the browser to treat that spot as “do not break here.” This tutorial explains what it is, when to use it, and how to write it in HTML — with plain Try It demos and no extra CSS.
U+00A0 explained.
Names, phones.
Named entity.
and .
What to avoid.
Real markup.
A non-breaking space is a space character that prevents an automatic line break at its position. In Unicode it is called NO-BREAK SPACE and has the code point U+00A0.
It looks identical to a normal space on screen, but the browser will not wrap text across it. That makes it useful when splitting certain words or numbers onto two lines would look wrong or confuse readers.
Think of as glue between two tokens. Mr. Smith keeps “Mr.” and “Smith” on the same line, even in a narrow column.
Non-breaking spaces are often used in the following scenarios:
10 and kg from splitting (10 kg).123 456 7890.Jan 5, 2026 or $19 USD.Regular spaces in HTML can collapse (multiple spaces become one). A non-breaking space does not collapse, which is another reason authors reach for in specific spots.
In HTML, a non-breaking space is represented by the entity . The name stands for “non-breaking space” and you can use it anywhere you need a space that will not collapse or break into a new line.
<p>Mr. Smith</p> In this example, “Mr.” and “Smith” will always appear on the same line, with a space between them that does not break.
| Form | Example | Notes |
|---|---|---|
| Named entity | | Most common in HTML tutorials |
| Decimal |   | Code point 160 in base 10 |
| Hexadecimal |   or   | Code point U+00A0 in base 16 |
| Literal character | Copy U+00A0 from a charset table | Works if your file is UTF-8 |
All of these produce the same character. For a full Unicode reference (CSS escapes, related spaces), see HTML Entity for Non-Breaking Space (U+00A0).
everywhere leads to rigid layouts and horizontal overflow on small screens. Use it only where wrapping would genuinely hurt readability. characters to indent or align content. Use CSS margin, padding, or text-align instead. fine, but hiding meaning inside non-breaking glue (e.g. breaking up a word letter-by-letter) can confuse assistive tech. Keep real words intact. is universally supported, but always preview narrow viewports to ensure your text still fits without unwanted scrolling. Named form
U+00A0NO-BREAK SPACE
 Numeric ref
no wrapAt this spot
Five short examples from a single line to a full page. Try It Yourself demos use plain HTML with no CSS so you can focus on .
<p>Mr. Smith</p>
<p>Dr. Jane Doe</p> The period after “Mr.” often sits at the end of a line when using a normal space. keeps the honorific glued to the name.
<p>Phone: 123 456 7890</p> Each digit group stays together; the line breaks only between groups if the container is very narrow.
<p>Weight: 10 kg</p>
<p>Temperature: 25 °C</p> Science and commerce copy often pairs a value with a unit. A non-breaking space avoids a lonely number on one line and the unit on the next.
<p>Named: Hello World</p>
<p>Decimal: Hello World</p>
<p>Hex: Hello World</p> Pick the form that matches your team’s style. Beginners usually start with because it is easy to remember.
A complete page combining phone spacing and an important notice — from the classic tutorial pattern, expanded with a date and price:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Non-Breaking Space Example</title>
</head>
<body>
<h1>HTML Non-Breaking Space Example</h1>
<p>Here is an example of using non-breaking spaces:</p>
<p>Phone Number: 123 456 7890</p>
<p>Important: Please read the instructions carefully.</p>
<p>Date: Jan 5, 2026</p>
<p>Price: $19 USD</p>
</body>
</html> In this example, the phone number displays with spaces that do not break to a new line mid-digit-group. The “Important” sentence keeps its rhythm without awkward single-word wraps.
When you write Important: Please read the instructions carefully., each marks a spot where the browser must not wrap. The phrase reads naturally but resists breaking in odd places on narrow screens.
Open Try It example 3 and narrow the preview panel to compare behavior with regular spaces.
Type (or a numeric equivalent) in your HTML source.
The browser replaces the token with Unicode character U+00A0.
Line breaking is forbidden at that position; whitespace does not collapse.
Visually it looks like a space, but surrounding tokens stay together when possible.
and U+00A0 are supported in every browser that renders HTML. There is nothing to polyfill or detect.
and U+00A0 are supported in every browser that renders HTML. There is nothing to polyfill or detect.
Bottom line: Use confidently for typography; prefer CSS for layout spacing when possible.
characters beat dozens sprinkled through a paragraph.white-space handle spacing more predictably than entity chains. is a typography tool, not a substitute for proper headings and lists.white-space: nowrap on a <span> can keep a whole phrase together without entity soup.The non-breaking space is a simple yet powerful tool in HTML for controlling the spacing and formatting of text. By understanding how and when to use , you can enhance the readability and presentation of your web content without reaching for heavy layout hacks.
For the full character reference (hex, decimal, CSS), continue to HTML Entity for Non-Breaking Space (U+00A0). Next up: learn how links work with the HTML <a> tag.
Remember these points when you use non-breaking spaces in your projects.
Same character everywhere.
UnicodeLine break blocked.
BehaviorEasiest to type.
SyntaxNot for layout.
CautionHTML also has a non-breaking hyphen (U+2011, ‑) that keeps hyphenated words like “self-driving” on one line. Spaces and hyphens solve different wrapping problems — see Non-Breaking Hyphen for details.
Type Mr. Smith, resize the preview, and see how non-breaking spaces keep text together — plain HTML, no CSS required.
5 people found this page helpful