Lesson 73 +5 XP

HTML Entity Reference

HTML Entity Reference

Entities are codes for characters that are special in HTML or hard to type. They start with & and end with ;.

The big three you must know

EntityShowsWhy it matters
&lt;<Stops the browser thinking you wrote a tag.
&gt;>Same for the closing bracket.
&amp;&& starts every entity, so escape it!
<p>2 &lt; 3 and 5 &gt; 4. Tom &amp; Jerry.</p>

Punctuation and quotes

EntityShowsEntityShows
&quot;"&apos;'
&nbsp;space (never breaks)&ensp;wide space
&emsp;extra wide space&sect;§
&para;&middot;·
&hellip;&ndash;-
&mdash; - &laquo;«

Currency symbols

EntityShowsEntityShows
&copy;©&reg;®
&trade;&euro;
&pound;£&yen;¥
&cent;¢&curren;¤

Math symbols

EntityShowsEntityShows
&sum;&radic;
&infin;&plusmn;±
&minus;&times;×
&divide;÷&equals;=
&ne;&le;
&ge;&asymp;
&deg;°&permil;
&micro;µ&frac14;¼

Greek letters

EntityShowsEntityShows
&alpha;α&beta;β
&gamma;γ&delta;δ
&theta;θ&lambda;λ
&pi;π&sigma;σ
&phi;φ&omega;ω
&Delta;Δ&Omega;Ω

Arrows

EntityShowsEntityShows
&larr;&rarr;
&uarr;&darr;
&harr;&crarr;
&rArr;&lArr;

Card suits and bullets

EntityShowsEntityShows
&spades;&clubs;
&hearts;&diams;
&bull;&star;

Number entities

Every character also has a number code. &#65; is the number 65, which is "A".

<p>&#65; is A, &#66; is B, &#128512; is an emoji.</p>

How to use entities

Just type them in your HTML text:

<p>I &hearts; HTML! &copy; 2026 My Site</p>

TL;DR

  • Entities start with & and end with ;.
  • Always escape <, >, and &: &lt;, &gt;, &amp;.
  • &copy;, &euro;, &pi;, &rarr; and friends type special symbols.
  • Number entities like &#65; use character numbers.
  • Use &nbsp; to keep words together.