Skip to content

HTML Blank Space Character, All Space Codes Free

Updated on

Copy the HTML non-breaking space and blank characters.

Recommended Character U+FFA0 — Medium

Generate specific quantity:

Test area — paste here to verify
Characters: 0

This tool generates Unicode spaces for formatting, usernames, and design. Nothing is installed or stored.

This tool generates Unicode spaces and special characters for formatting, usernames, testing, and design purposes. No software is installed, no personal data is collected, and no device changes are made.

This tool is intended for formatting and design use only.

HTML treats spaces differently than most people expect. A regular keyboard space works in plain text, but inside HTML markup, multiple consecutive spaces collapse into a single space. If you need more than one space, a non-breaking space, or a zero-width space, you need an HTML character entity.

The InvisiGenz HTML blank space character tool gives you the most-used HTML space entities in one place. Copy the character you need and paste it directly into your HTML, your text editor, or any web-compatible text field.

What Is a Blank Space Character in HTML?

A blank space character in HTML is a character entity or Unicode code point that produces a space of a specific width when rendered in a browser. Different space characters produce different widths and behave differently under browser rendering rules.

HTML space characters are expressed either as named entities like   or as numeric character references like  . Both produce the same output in the browser.

Why Does HTML Ignore Regular Spaces?

HTML follows a whitespace collapsing rule. Any sequence of whitespace characters, including spaces, tabs, and line breaks, is collapsed into a single space when rendered in normal text flow. If you type five spaces in HTML, the browser renders only one.

This is by design. HTML is a markup language, not a text formatter. Spacing and layout are handled by CSS, not by space characters. When you need actual space characters to appear in content, you use HTML entities.

What Is the HTML Code for a Blank Space?

The HTML code for a non-breaking space is  . This is the most commonly used HTML blank space character. It produces a space that does not collapse and does not break across lines.

Here are the main HTML space character entities with their Unicode code points and descriptions:

NameHTML EntityNumeric CodeUnicodeWidth
Non-Breaking Space  U+00A0Normal space width
En Space  U+2002Half an em
Em Space  U+2003One em (wide)
Thin Space  U+2009Narrow space
Hair Space  U+200AVery narrow space
Zero-Width Space​​U+200BNo width
Zero-Width Non-Joiner‌‌U+200CNo width
Zero-Width Joiner‍‍U+200DNo width
Word Joiner⁠⁠U+2060No width
Ideographic Space  U+3000Wide (CJK width)

For the complete Unicode listing of all blank and invisible characters and their code points, visit the Unicode table for a full reference.

What Is the Non-Breaking Space in HTML?

HTML blank space character explained

The non-breaking space ( ) is the most important and most used HTML blank space character. It was standardized in HTML 2.0 and remains a fundamental part of HTML web development.

It does two things that regular spaces cannot.

First, it does not collapse. Multiple consecutive   entities each render as a visible space. You can stack five   entities and get five visible spaces in the browser output.

Second, it does not break across lines. A regular space is a valid line-break point. When text wraps, the browser can break a line at any space. A non-breaking space prevents line wrapping at that point. The two words on either side of a   will always appear on the same line.

When Should You Use nbsp?

Use   when you need a space that will not collapse in HTML text. Common cases include:

  • Formatting numbers: “100 km” where the number and unit should stay together on one line
  • Names and titles: “Dr. Smith” where a line break between the title and name looks wrong
  • Preventing blank table cells from collapsing: Empty <td> cells in HTML tables sometimes collapse to zero height. A &nbsp; inside keeps the cell visible
  • Adding visual spacing in text-heavy content: When you need a small visible gap between elements but do not want to use margin or padding in CSS

When Should You Avoid nbsp?

Avoid using &nbsp; for layout and indentation. That is what CSS margins, padding, and spacing properties are for. Overusing &nbsp; for layout creates maintenance problems and can cause accessibility issues. Screen readers may announce multiple non-breaking spaces in ways that disrupt the reading flow.

What Are the Different Types of HTML Space Characters?

En Space and Em Space

The en space (&ensp;) is half the width of the current font’s em measurement. The em space (&emsp;) is equal to the full em measurement of the current font. These are typographic space units that match the spacing standards used in print typography.

Em spaces are noticeably wider than regular spaces. They are used for typographic indentation, formal document formatting, and situations where the wider space is intentional and visible.

Thin Space and Hair Space

The thin space (&thinsp;) is typically one-fifth of an em. It is used in formal typography between a number and its unit (for example, “50 kg”) and in some punctuation conventions around quotation marks or dashes.

The hair space (&hairsp;) is even narrower, typically one-sixth to one-tenth of an em. It is primarily a typographic fine-tuning tool used in professional print and publishing contexts.

Zero-Width Space

The zero-width space (U+200B) has no visible width. It is completely invisible in rendered text. Unlike &nbsp;, it produces no space at all.

Its primary use in HTML and web development is as a line-break opportunity. Browsers do not break long strings of characters (like URLs or long code values) at arbitrary points. A zero-width space inserted in the string tells the browser that a line break is allowed at that point, without adding any visible space.

Zero-width characters are also the basis of invisible characters used on social media platforms and in games. The invisible character functions in the same way: it is present in the text field but produces nothing visible.

How Do You Add Multiple Spaces in HTML?

The most straightforward way is to use multiple &nbsp; entities.

Word&nbsp;&nbsp;&nbsp;&nbsp;Word

This renders four visible spaces between the two words.

The <pre> HTML element is another option. Content inside <pre> tags preserves whitespace exactly as typed, including multiple spaces and line breaks. This is how code samples and preformatted text are handled in HTML.

CSS also provides whitespace control via the white-space property. Setting white-space: pre or white-space: pre-wrap on an element makes it treat multiple spaces the same way the <pre> tag does.

What Is the Difference Between HTML Whitespace and CSS Whitespace?

HTML whitespace refers to the raw space characters in the HTML source code: spaces, tabs, and line breaks between and within HTML elements. By default, HTML collapses all of these.

CSS whitespace refers to the visual spacing rendered on screen. CSS properties like margin, padding, letter-spacing, word-spacing, and white-space control how space appears visually, independent of what is in the HTML source.

HTML character entities like &nbsp; insert actual characters into the document content. CSS properties control the appearance of elements without adding characters to the content. For accessibility and maintainability, CSS is preferred for layout spacing. HTML entities are reserved for situations where a specific character must exist in the content itself.

How Do HTML Blank Space Characters Work Outside Web Pages?

HTML entities only render in HTML contexts. A &nbsp; pasted into a WhatsApp message or a gaming name field will appear as the literal text ” ” not as a space.

For non-HTML contexts, the raw Unicode character is used instead of the HTML entity. The non-breaking space Unicode character (U+00A0) pasted directly into a text field produces the same visual effect without the HTML syntax. Many of the same Unicode characters used in HTML entities are also used as invisible characters in social media, messaging apps, and games.

For a blank WhatsApp message, the raw Unicode invisible character is pasted directly into the message field, not the HTML entity. Visit the WhatsApp blank message page for the exact character that works in WhatsApp’s message field.

In games like Free Fire, the invisible character used for blank player names is a raw Unicode character, not an HTML entity. Visit the Free Fire invisible name page for the gaming-specific method.

The InvisiGenz invisible character generator lets you copy raw Unicode invisible characters for use in any context, whether you are working in HTML or on a social media platform.

FAQ

Frequently Asked Questions

The most common HTML code for a blank space is   which stands for non-breaking space. It can also be written as the numeric entity  . Other HTML space codes include  ,  , and   for different space widths.

A regular space in HTML is collapsed with other consecutive spaces into a single space by the browser.   does not collapse, does not break across lines, and each entity produces one visible space independently of any others.

Use multiple   entities in a row. Each one produces one space that the browser will not collapse. Alternatively, use the

 element or CSS white-space: pre property to preserve all space characters as typed.

The white space characters in HTML include the regular space (U+0020), the non-breaking space (U+00A0 or  ), the en space (U+2002), the em space (U+2003), the thin space (U+2009), and the zero-width space (U+200B).

The most recognized HTML empty space symbol is  . It represents a non-breaking space that renders as visible blank space in the browser.

A zero-width space (U+200B or ​) is an invisible character with no visible width. It is used as a line-break opportunity in long strings. It also serves as the basis for invisible characters used in social media text fields.

A   character tells the browser that the space between two pieces of text is not a valid line-break point. The browser must keep both pieces of text on the same line, even if the combined text is wider than the container.

You can, but it is not recommended. CSS margin and padding are the correct tools for layout spacing. Using multiple   entities for indentation creates content that is harder to maintain and can create accessibility issues.

About the Author
Daniel Hill

Meet the Creator
of InvisiGen

Daniel Hill
Software Engineer & Web Developer

Daniel Hill is a software engineer and developer, as well as the creator of InvisiGen. He specializes in Unicode and text-formatting tools. He built InvisiGen to make invisible characters easy to copy and test, while keeping the platform free and privacy-first for everyone.

Get In Touch