View All HTML Tutorials

HTML Entities and Special Characters Explained

Learn how HTML entities display special characters such as ampersands, angle brackets, copyright symbols, and non-breaking spaces.

Infographic explaining HTML entities, special characters, ampersands, angle brackets, copyright symbols, and non-breaking spaces.

Introduction

HTML pages often include characters that need special handling.

For example, you may want to display a copyright symbol, an ampersand, angle brackets, quotation marks, currency symbols, or a space that should not break across two lines.

HTML entities are one way to write these special characters safely in your HTML code.

For example:

HTML
©

displays as:

TEXT
©

Another example:

HTML
&

displays as:

TEXT
&

HTML entities are useful when a character has special meaning in HTML, when a symbol is difficult to type, or when you need more control over spacing.

What Is an HTML Entity?

An HTML entity is a special code that represents a character.

Most named entities start with an ampersand:

HTML
&

and end with a semicolon:

HTML
;

For example:

HTML
©

This is the HTML entity for the copyright symbol.

When the browser reads this code, it displays:

TEXT
©

The entity is what you write in the HTML.

The character is what the browser displays.

Why HTML Entities Are Useful

HTML entities are useful for several reasons.

Some characters have special meaning in HTML.

For example, the less-than sign is used to start HTML tags:

HTML
<

If you want to display a less-than sign as text, you should write:

HTML
<

Some characters may be hard to type on a keyboard.

For example, the copyright symbol can be written as:

HTML
©

Some spacing needs special control.

For example, a non-breaking space can be written as:

HTML
 

HTML entities help the browser understand whether a character is part of the HTML code or something that should be displayed to the user.

The copyright entity is:

HTML
©

It displays as:

TEXT
©

This is often used in website footers.

For example:

HTML
<footer>  <p>© 2026 Bright Web Studio. All rights reserved.</p></footer>

The browser displays:

TEXT
© 2026 Bright Web Studio. All rights reserved.

You can also type the copyright symbol directly:

HTML
<p>© 2026 Bright Web Studio</p>

Both can work. However, using &copy; is common in HTML because it is easy to recognise and reliable in code.

The Ampersand Entity: &amp;

The ampersand entity is:

HTML
&

It displays as:

TEXT
&

This is important because the ampersand is used to start HTML entities.

For example, this entity:

HTML
©

starts with an ampersand.

If you want to display a normal ampersand in text, it is safest to write:

HTML
&

For example:

HTML
<p>Design & Development</p>

The browser displays:

TEXT
Design & Development

Why Ampersands Need Care

In many cases, a browser may still display a plain ampersand correctly.

For example:

HTML
<p>Design & Development</p>

may display as expected.

However, it is better practice to write:

HTML
<p>Design & Development</p>

This avoids confusion because the ampersand has a special role in HTML.

This is especially important in URLs or text that contains query strings.

For example:

HTML
<a href=”search.html?category=html&level=intro”>Search HTML lessons</a>

In the browser, the URL still works with an ampersand between the parameters.

In the HTML source code, &amp; makes the ampersand safe and clear.

The Less-Than Entity: &lt;

The less-than entity is:

HTML
<

It displays as:

TEXT
<

This is very useful when writing tutorials about HTML.

For example, if you want to show the <p> tag as text, you should not write this directly inside a paragraph:

HTML
<p>The <p> tag creates a paragraph.</p>

The browser may treat the second <p> as a real HTML tag.

Instead, write:

HTML
<p>The <p> tag creates a paragraph.</p>

The browser displays:

TEXT
The <p> tag creates a paragraph.

The Greater-Than Entity: &gt;

The greater-than entity is:

HTML
>

It displays as:

TEXT
>

It is often used with &lt; when displaying HTML tags as text.

For example:

HTML
<p>Use <h1> for the main heading of a page.</p>

The browser displays:

TEXT
Use <h1> for the main heading of a page.

The less-than sign starts the displayed tag.

The greater-than sign ends the displayed tag.

Together, &lt; and &gt; allow you to show HTML code without the browser treating it as real markup.

Displaying HTML Code as Text

HTML entities are especially useful when displaying code examples.

For example, to show this code to the user:

HTML
<p>This is a paragraph.</p>

you need to write it like this in your HTML:

HTML
<pre><code><p>This is a paragraph.</p></code></pre>

The browser then displays the code instead of turning it into a real paragraph.

This is common in HTML tutorials, documentation, and learning resources.

Non-Breaking Spaces: &nbsp;

The non-breaking space entity is:

HTML
 

It displays as a space, but it prevents a line break at that point.

A normal space allows text to break across lines.

A non-breaking space keeps two pieces of text together.

For example:

HTML
<p>Price: £10 per month</p>

This helps keep parts of the phrase together instead of allowing awkward line breaks.

Another example:

HTML
<p>Chapter 1</p>

This keeps “Chapter” and “1” together on the same line.

When to Use a Non-Breaking Space

Use &nbsp; when two pieces of text should stay together.

Common examples include:

TEXT
names and initialsnumbers and unitsshort labels and valuescurrency amountsdates or references

For example:

HTML
<p>Dr Smith</p>
HTML
<p>10 kg</p>
HTML
<p>£25 per hour</p>
HTML
<p>Section 4</p>

In each example, the non-breaking space helps prevent an awkward line break.

Do Not Use &nbsp; for Layout Spacing

A common mistake is using lots of non-breaking spaces to push content across the page.

Avoid this:

HTML
<p>Home     About     Contact</p>

This is not a good way to create layout spacing.

Use proper HTML and CSS instead:

HTML
<nav>  <a href=”index.html”>Home</a>  <a href=”about.html”>About</a>  <a href=”contact.html”>Contact</a></nav>
CSS
nav {  display: flex;  gap: 24px;}

Use &nbsp; for non-breaking text, not visual layout.

Common Symbol Entities

HTML includes many named entities for symbols.

For example:

HTML
©

displays:

TEXT
©
HTML
®

displays:

TEXT
®
HTML

displays:

TEXT
HTML
£

displays:

TEXT
£
HTML

displays:

TEXT
HTML

displays:

TEXT
HTML

displays:

TEXT

These entities can be useful when you need symbols that are not always easy to type.

Common Entity Reference Table

Here are some useful HTML entities:

TEXT
Entity      Displays as     Meaning©      ©               copyright&       &               ampersand<        <               less-than sign>        >               greater-than sign       space           non-breaking space®       ®               registered trademark™     ™               trademark£     £               pound sign€      €               euro sign—     —               em dash–     –               en dash"      ”               quotation mark&apos;      ‘               apostrophe

The most important ones for many HTML learners are:

HTML
&
HTML
<
HTML
>
HTML
 

and:

HTML
©

These appear often in real HTML code.

Named Entities and Numeric Entities

Many characters can be written as named entities or numeric entities.

A named entity uses a readable name.

For example:

HTML
©

A numeric entity uses a number.

For example:

HTML
©

Both display:

TEXT
©

Another example:

HTML
£

and:

HTML
£

both display:

TEXT
£

Named entities are often easier to read when they are available.

Numeric entities are useful when a named entity is not available or when you are working with a specific character code.

Using Symbols Directly

Modern HTML pages commonly use UTF-8 character encoding.

That means many symbols can be typed directly into the HTML file.

For example:

HTML
<p>© 2026 Bright Web Studio</p>
HTML
<p>Price: £25</p>
HTML
<p>Temperature: 20°C</p>

These can work correctly when the page uses UTF-8.

A typical HTML document includes:

HTML
<meta charset=”UTF-8″>

inside the <head>:

HTML
<head>  <meta charset=”UTF-8″>  <title>My Page</title></head>

Using UTF-8 makes it easier to display a wide range of characters and symbols.

Entities vs Direct Characters

In modern HTML, both of these can work:

HTML
<p>© 2026 Bright Web Studio</p>

and:

HTML
<p>© 2026 Bright Web Studio</p>

Both display:

TEXT
© 2026 Bright Web Studio

So when should you use an entity?

Use entities when the character has special meaning in HTML, such as:

HTML
&
HTML
<
HTML
>

Use entities when they make the code clearer or easier to type, such as:

HTML
©

Use direct characters when they are easy to type, readable, and your document uses UTF-8.

Entities Must End with a Semicolon

HTML entities should end with a semicolon.

Correct:

HTML
©

Incorrect:

HTML
&copy

Correct:

HTML
&

Incorrect:

HTML
&amp

Some browsers may still understand some entities without the semicolon, but you should not rely on that.

Always include the semicolon.

It makes the code clearer and avoids parsing problems.

Entities Are Case-Sensitive

Many named entities are case-sensitive.

That means uppercase and lowercase letters can matter.

For example:

HTML
©

is the standard named entity for the copyright symbol.

Writing the wrong case may not work as expected.

As a habit, copy entity names carefully and keep them consistent.

Using Entities in Attributes

HTML entities can also appear inside attribute values.

For example:

HTML
<img src=”images/logo.png” alt=”Bright Web Studio & Design logo”>

The alt text will be understood as:

TEXT
Bright Web Studio & Design logo

Another example:

HTML
<a href=”search.html?topic=html&level=intro”>HTML introduction search</a>

The href value uses &amp; to represent the ampersand safely.

Entities are not only for visible text between tags. They can also be useful inside attributes.

A Complete Example

Here is a complete HTML page using several entities and special characters:

HTML
<!DOCTYPE html><html lang=”en”><head>  <meta charset=”UTF-8″>  <title>HTML Entities Example</title></head><body>   <h1>HTML Entities</h1>   <p>© 2026 Bright Web Studio. All rights reserved.</p>   <p>Design & Development services for small businesses.</p>   <p>The <p> element creates a paragraph.</p>   <p>Use <img> to add an image to a page.</p>   <p>Price: £25 per hour.</p>   <p>Registered trademark symbol: ®</p> </body></html>

This example uses:

HTML
©

for the copyright symbol,

HTML
&

for the ampersand,

HTML
<

and:

HTML
>

to display HTML tags,

HTML
 

to keep text together,

and:

HTML
®

for the registered trademark symbol.

Common Mistake: Forgetting to Escape Angle Brackets

If you are trying to display HTML code, do not write the tags directly.

Incorrect:

HTML
<p>The <img> element adds an image.</p>

Better:

HTML
<p>The <img> element adds an image.</p>

The first example may be interpreted as actual HTML.

The second example displays the tag as text.

Common Mistake: Forgetting &amp;

Ampersands should usually be escaped as &amp; in HTML text and attributes.

Less careful:

HTML
<p>Design & Development</p>

Better:

HTML
<p>Design & Development</p>

This is clearer because & starts HTML entities.

It is especially important in URLs:

HTML
<a href=”search.html?topic=html&level=intro”>Search</a>

Common Mistake: Using &nbsp; for Indentation

Do not use non-breaking spaces to indent text or create columns.

Avoid:

HTML
<p>    Indented text</p>

Better:

HTML
<p class=”indented-text”>Indented text</p>
CSS
.indented-text {  margin-left: 2rem;}

Use CSS for visual spacing.

Use &nbsp; only when text should not break across lines.

Common Mistake: Missing the Semicolon

Incorrect:

HTML
&copy

Correct:

HTML
©

Incorrect:

HTML
&lt

Correct:

HTML
<

The semicolon is part of the entity syntax.

Always include it.

Common Mistake: Overusing Entities

You do not need to replace every symbol with an entity.

For example, if your page uses UTF-8, this is usually fine:

HTML
<p>Price: £25</p>

You could also write:

HTML
<p>Price: £25</p>

Both can work.

The most important entities to remember are the ones that prevent HTML confusion:

HTML
&
HTML
<
HTML
>

and the ones you use often, such as:

HTML
©

and:

HTML
 

Best Practices

Use &copy; for the copyright symbol when writing website footers.

Use &amp; when you need to display an ampersand safely.

Use &lt; and &gt; when displaying HTML tags as text.

Use &nbsp; only when text should stay together on one line.

Do not use &nbsp; for layout spacing or indentation.

Always include the semicolon at the end of an entity.

Use UTF-8 for modern HTML pages.

Use direct symbols when they are readable, easy to type, and safe.

Use entities when the character has special meaning in HTML or improves clarity.

Summary

HTML entities are special codes used to display characters safely in HTML.

For example:

HTML
©

displays:

TEXT
©
HTML
&

displays:

TEXT
&
HTML
<

displays:

TEXT
<
HTML
>

displays:

TEXT
>
HTML
 

creates a non-breaking space.

Use entities when characters have special meaning in HTML, when symbols are hard to type, or when you need to control whether text can break across lines.

For modern HTML, make sure your page uses UTF-8:

HTML
<meta charset=”UTF-8″>

Once you understand entities, it becomes easier to display symbols, write clear code examples, and avoid confusing the browser with characters that have special meaning in HTML.