Lesson 73 +5 XP

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
<<Stops the browser thinking you wrote a tag.
>>Same for the closing bracket.
&&& starts every entity, so escape it!
Code

html
<p>2 &lt; 3 and 5 &gt;

4. Tom &amp; Jerry.</p>

Punctuation and quotes

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

Currency symbols

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

Math symbols

EntityShowsEntityShows
&amp;sum;∑&amp;radic;√
&amp;infin;∞&amp;plusmn;±
&amp;minus;−&amp;times;×
&amp;divide;÷&amp;equals;=
&amp;ne;≠&amp;le;≤
&amp;ge;≥&amp;asymp;≈
&amp;deg;°&amp;permil;‰
&amp;micro;µ&amp;frac14;¼

Greek letters

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

Arrows

EntityShowsEntityShows
&amp;larr;←&amp;rarr;→
&amp;uarr;↑&amp;darr;↓
&amp;harr;↔&amp;crarr;↵
&amp;rArr;⇒&amp;lArr;⇐

Card suits and bullets

EntityShowsEntityShows
&amp;spades;♠&amp;clubs;♣
&amp;hearts;♥&amp;diams;♦
&amp;bull;•&amp;star;⋆

Number entities

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

Code

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

How to use entities

Just type them in your HTML text:

Code

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

TL;DR

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