HTML entities are used to account for reserved characters or special symbols in the code output. These entities are clearly defined sequences that signal to the browser to display a specific character.

What are HTML entities?

HTML entities offer the possibility to express certain characters in an HTML document, which:

  • are not naturally available in the input method being used or are difficult to enter.
  • are reserved for HTML and fulfill their own coding function.

In order to still be able to map these characters without damaging the code, these clearly definable character strings are used. A distinction is made between named entities (entity names) and numeric entities (entity numbers). While named HTML entities are easier to read and remember, numerical entities are particularly important when there is no named variant.

Web hosting
The hosting your website deserves at an unbeatable price
  • Loading 3x faster for happier customers
  • Rock-solid 99.99% uptime and advanced protection
  • Only at IONOS: up to 500 GB included

Named HTML entities

Named HTML entities have the following format:

&entity_name;
html

To display the ampersand symbol &, it needs to be coded as & (short for ampersand). The example below demonstrates how this entity is used:

<!DOCTYPE html>
<html>
<body>
<h1>Example of a named entity</h1>
<h2>The ampersand looks like this: &amp</h2>
</body>
</html>
html
Note

Named HTML entities are case-sensitive so make sure to check upper and lower case.

Numeric HTML entities

Numeric HTML entities are written in the following format:

&#entity_number;
html

In place of entity_number, enter the Unicode value of the character you want to use. To write an ampersand, for example, you would use the character string &#38;. Here’s what a numeric HTML entity looks like inside code:

<!DOCTYPE html>
<html>
<body>
<h1>Example of a numeric entity</h1>
<h2>The ampersand looks like this: &#38;</h2>
</body>
</html>
html
Register your domain name
Launch your business on the right domain
  • Free WordPress with .co.uk
  • Free website protection with one Wildcard SSL
  • Free Domain Connect for easy DNS setup

List of common HTML entities

Whether you’re just starting to learn HTML or have been using the markup language for some time, having a list of the most important HTML entities is always helpful. In the following sections, you’ll find some of the most commonly used HTML entities listed by category.

Punctuation

Character Description Named Numeric
Non-breaking space &nbsp; &#160;
. Period &period; &#46;
, Comma &comma; &#44;
! Exclamation mark &excl; &#33;
? Question mark &quest; &#63;
& Ampersand &amp; &#38;
Quotation marks &quot; &#34;
Apostrophe &apos; &#39;
# Hash &num; &#35;
( Left bracket &lpar; &#40;
) Right bracket &rpar; &#41;
% Percent sign &percnt; &#37;
§ Section sign &sect; &#167;

Special characters

Character Description Named Numeric
© Copyright &copy; &#169;
® Registered trademark &reg; &#174;
Trademark &trade; &#8482;
@ At sign &commat; &#64;
Female symbol &female; &#9792;
Male symbol &male; &#9794;
Tick &check; &#10003;
Cross mark &cross; &#10007;

Mathematical symbols

Character Description Named Numeric
+ Plus sign &plus; &#43;
Minus sign &minus; &#8722;
× Multiplication sign &times; &#215;
÷ Division sign &divide; &#247;
= Equals sign &equals; &#61;
< Less than &lt; &#60;
> Greater than &gt; &#62;

Currencies

Character Description Named Numeric
Euro &euro; &#8364;
¢ Cent &cent; &#162;
$ Dollar &dollar; &#36;
£ Pound &pound; &#163;
¥ Yen &yen; &#165;
Tip

Our Digital Guide has many more articles on Hypertext Markup Language (HTML) and related topics. For example, you can explore what HTML tags are, the special features of HTML5 and how to get started with CSS.

Was this article helpful?
Go to Main Menu