LOGBOOK

HELP

Quiz Entry - updated: 2026.07.14

What are HTML entities and when are they needed?

HTML entities are escape codes like < that let you write characters which would otherwise be misread as HTML syntax (or aren't easy to type).

The problem they solve: a few characters have special meaning to the browser. If you literally type a <, the browser thinks a tag is starting. To display the character itself, you escape it with an entity — a code that begins with & and ends with ;. The ones that must be escaped because they collide with HTML syntax are:

Character Entity
& &amp;
< &lt;
> &gt;
" &quot;
' &#39;

For example, to show the text 5 < 10 && 10 > 5:

<p>5 &lt; 10 &amp;&amp; 10 &gt; 5</p>

Entities were also historically used for accented or non-keyboard letters — for instance ü could be written &uuml;. That use is now considered outdated: the modern approach is simply to declare a Unicode character set in the head, after which you can type almost any character directly:

<meta charset="utf-8">

UTF-8 covers virtually every character on Earth, so entities are now needed only for the handful that clash with HTML's own syntax.

Go deeper:

From Quiz: WEBT / HTML Documents | Updated: Jul 14, 2026