HTML Entities Cheat Sheet: Complete Reference Guide

All the special characters your HTML needs, in one bookmark-worthy page

< & > © ™

TL;DR: HTML entities are special codes (like &amp; for & and &lt; for <) that let you safely display reserved characters in HTML. You MUST escape &, <, >, and quotes. For everything else, UTF-8 usually has you covered — but entities are great for invisible characters and symbols you can't type.

Ever typed a < in your HTML and watched your entire page break? Congratulations, you've just discovered why HTML entities exist! They're the escape hatches that let you display characters the browser would otherwise try to interpret as code.

What Are HTML Entities, Anyway?

An entity is a string that starts with & and ends with ;. It tells the browser: "Hey, don't try to interpret this — just display this specific character." They come in two flavors:

All three of &copy;, &#169;, and &#xA9; render the same thing: ©. Named entities are easier to read in source code, but numeric ones work for any Unicode character.

🎭 HTML entities: letting characters play pretend so your browser doesn't freak out

The Big Five: Characters You MUST Escape

These five characters have special meaning in HTML. If you use them as plain text without escaping, things will break:

CharacterEntityNumericWhy It's Special
&&amp;&#38;Starts an entity reference
<&lt;&#60;Opens an HTML tag
>&gt;&#62;Closes an HTML tag
"&quot;&#34;Delimits attribute values
'&apos;&#39;Also delimits attribute values
😄

Dev Joke: A developer walks into a bar and orders a <beer>. The bartender says "Sorry, we don't serve HTML tags." The developer replies: "Fine, give me a &lt;beer&gt;."

Your Go-To Symbol Reference

Currency Symbols

SymbolEntityDescription
¢&cent;Cent sign
£&pound;Pound sterling
¥&yen;Yen / Yuan
&euro;Euro sign
&#8377;Indian Rupee (no named entity)

Typography Essentials

SymbolEntityWhat It Is
©&copy;Copyright (every footer ever)
®&reg;Registered trademark
&trade;Trademark
°&deg;Degree sign (72°F)
&bull;Bullet point
&hellip;Ellipsis (...but classier)
&ndash;En dash (for ranges: 1–10)
&mdash;Em dash — the king of dashes
&ldquo;Left double quote “
&rdquo;Right double quote ”

Arrows

SymbolEntityDescription
&larr;Left arrow
&rarr;Right arrow
&uarr;Up arrow
&darr;Down arrow
«&laquo;Double angle left «
»&raquo;Double angle right »

Math Symbols

SymbolEntityDescription
×&times;Multiplication (not the letter x!)
÷&divide;Division
±&plusmn;Plus-minus
&ne;Not equal
&infin;Infinity ∞
📖 Bookmark this page — you'll be back (we all come back)

The Invisible Characters

HTML collapses multiple spaces into one. These entities give you precise whitespace control:

EntityWhat It DoesWidth
&nbsp;Non-breaking space (keeps words together)Normal space
&ensp;En spaceHalf an em
&emsp;Em spaceOne em width
&thinsp;Thin spaceAbout 1/5 em
💡

Pro Tip: The main use of &nbsp; is preventing line breaks between words that should stay together, like "100 km" or "Dr. Smith." Don't use it for layout spacing — that's what CSS margin and padding are for!

Encoding & Decoding in JavaScript

Here's a neat trick — let the browser do the work:

// Encode: text → HTML entities
function encodeHTML(text) {
  const div = document.createElement('div');
  div.textContent = text;
  return div.innerHTML;
}

encodeHTML('<script>alert("xss")</script>');
// "&lt;script&gt;alert(&quot;xss&quot;)&lt;/script&gt;"

// Decode: HTML entities → text
function decodeHTML(html) {
  const div = document.createElement('div');
  div.innerHTML = html;
  return div.textContent;
}
⚠️

Security Reminder: Always encode user-generated content before inserting it into HTML. This is your first line of defense against XSS (Cross-Site Scripting) attacks. Never trust user input!

Do I Even Need Entities in 2026?

With modern UTF-8 encoding (which you should always use), you can type most characters directly. You only need entities when:

For accented characters, emoji, and international text — just type them directly with <meta charset="UTF-8"> in place.

🛡️ HTML entities: part reference guide, part security tool

Wrapping Up

HTML entities are one of those things every web developer needs to know. The Big Five reserved-character entities are non-negotiable for correctness and security. Beyond that, entities give you a portable way to include symbols, typography, and invisible spacing in your markup. Bookmark this page — you'll be back.

Try It Yourself

Encode and decode HTML entities instantly — paste any text and see the entity-encoded version in real time.

Open HTML Entity Encoder →