HTML — Lesson 13

HTML Entities & Symbols

Using special characters and symbols in HTML.

By Majed Qandeel · Jul 26, 2026 · Lesson 13 of 25

HTML Entities & Symbols

HTML entities let you display reserved characters and special symbols that cannot be typed directly or have special meaning in HTML.

Entity Syntax

Entities follow the format: &name; or &#number;

<!-- By name --> &lt; <!-- less than: < --> &gt; <!-- greater than: > --> &amp; <!-- ampersand: & --> <!-- By numeric code --> &#60; <!-- also < --> &#62; <!-- also > -->

Common HTML Entities

EntityCodeCharacterUse Case
&amp;&amp;&Ampersand in text
&lt;&lt;<Less-than sign
&gt;&gt;>Greater-than sign
&nbsp;&nbsp;SpaceNon-breaking space
&copy;&copy;©Copyright symbol
&reg;&reg;®Registered trademark
&trade;&trade;Trademark symbol
&mdash;&mdash;Em dash
&ndash;&ndash;En dash
&quot;&quot;"Double quote in attributes

Non-Breaking Spaces

&nbsp; prevents line breaks at that position and collapses multiple spaces.

<!-- Normal spaces collapse: "A B C" becomes "A B C" --> <p>A B C</p> <!-- nbsp keeps spaces and prevents wrapping --> <p>A &nbsp; B &nbsp; C</p> <p>100&nbsp;km</p> <!-- "100 km" won't break apart -->

Displaying Code in HTML

When showing code examples, you must escape HTML characters.

<p>Showing HTML code without entities:</p>
<code>&lt;p&gt;Hello &amp; Welcome!&lt;/p&gt;</code>

<p>Special symbols and emoji:</p>
<p>Arrow: &rarr; &rarr; &clubs; &hearts; &diams;</p>
<p>Copyright: &copy; 2026 My Company</p>
<p>Currency: $ &euro; &pound; &yen;</p>
<p>Math: &plusmn; &times; &divide; &ne;</p>
Tip: The most critical entities to remember are &amp;, &lt;, and &gt;. Any time you display HTML code as text, these three must be escaped.

Practice what you learned in the Deoit Editor — a free, browser-based code editor.

Open Editor →