HTML Entities Cheat Sheet

The characters you must escape, every common named entity with its decimal and hex code, and how to escape safely in each part of a page.

Cheat sheetPrintableFree, no login

Updated 28 October 2026

Encode text to named, decimal or hex entities, or decode any entity back to text.

Open the HTML entities tool

Entity syntax

An HTML entity writes a character as text the browser turns back into the character. There are three forms, and all of them end in a semicolon:

FormPatternExample for ©
Named&name;©
Decimal&#number;©
Hexadecimal&#xhex;©

Named entities are case-sensitive (É is É, é is é). Numeric forms work for every Unicode character, including emoji: 😀 is 😀.

Characters you must escape

CharNamedDecimalHexDescription
&&&&Ampersand — always, everywhere
<&lt;&#60;&#x3C;Less than — in text
>&gt;&#62;&#x3E;Greater than — in text (recommended)
"&quot;&#34;&#x22;Double quote — inside double-quoted attributes
'—&#39;&#x27;Apostrophe — inside single-quoted attributes. &apos; works in HTML5 but not HTML4

Escaping these five is enough to show any text safely inside HTML elements and quoted attributes. Click any entity to copy it.

Spaces, dashes and quotes

CharNamedDecimalHexDescription
(space)&nbsp;&#160;&#xA0;Non-breaking space
(space)&ensp;&#8194;&#x2002;En space
(space)&emsp;&#8195;&#x2003;Em space
(space)&thinsp;&#8201;&#x2009;Thin space
­&shy;&#173;&#xAD;Soft hyphen (shown only at a line break)
–&ndash;&#8211;&#x2013;En dash — ranges (1–5)
—&mdash;&#8212;&#x2014;Em dash
…&hellip;&#8230;&#x2026;Ellipsis
‘&lsquo;&#8216;&#x2018;Left single quote
’&rsquo;&#8217;&#x2019;Right single quote, apostrophe
“&ldquo;&#8220;&#x201C;Left double quote
”&rdquo;&#8221;&#x201D;Right double quote
«&laquo;&#171;&#xAB;Left guillemet
»&raquo;&#187;&#xBB;Right guillemet
•&bull;&#8226;&#x2022;Bullet
·&middot;&#183;&#xB7;Middle dot

Symbols

CharNamedDecimalHexDescription
©&copy;&#169;&#xA9;Copyright
®&reg;&#174;&#xAE;Registered trademark
™&trade;&#8482;&#x2122;Trademark
§&sect;&#167;&#xA7;Section
&para;&#182;&#xB6;Paragraph
†&dagger;&#8224;&#x2020;Dagger
°&deg;&#176;&#xB0;Degree
✓&check;&#10003;&#x2713;Check mark
✗&cross;&#10007;&#x2717;Ballot X
♥&hearts;&#9829;&#x2665;Heart
★&starf;&#9733;&#x2605;Black star

Currency

CharNamedDecimalHexDescription
€&euro;&#8364;&#x20AC;Euro
£&pound;&#163;&#xA3;Pound
¥&yen;&#165;&#xA5;Yen / yuan
¢&cent;&#162;&#xA2;Cent
₹—&#8377;&#x20B9;Indian rupee (no named entity)
₩—&#8361;&#x20A9;Korean won
₿—&#8383;&#x20BF;Bitcoin

Math

CharNamedDecimalHexDescription
×&times;&#215;&#xD7;Multiply
÷&divide;&#247;&#xF7;Divide
±&plusmn;&#177;&#xB1;Plus-minus
−&minus;&#8722;&#x2212;Minus sign
≠&ne;&#8800;&#x2260;Not equal
≤&le;&#8804;&#x2264;Less or equal
≥&ge;&#8805;&#x2265;Greater or equal
≈&asymp;&#8776;&#x2248;Almost equal
∞&infin;&#8734;&#x221E;Infinity
½&frac12;&#189;&#xBD;One half
¼&frac14;&#188;&#xBC;One quarter
²&sup2;&#178;&#xB2;Superscript 2
µ&micro;&#181;&#xB5;Micro
‰&permil;&#8240;&#x2030;Per mille

Arrows

CharNamedDecimalHexDescription
←&larr;&#8592;&#x2190;Left arrow
→&rarr;&#8594;&#x2192;Right arrow
↑&uarr;&#8593;&#x2191;Up arrow
↓&darr;&#8595;&#x2193;Down arrow
↔&harr;&#8596;&#x2194;Left-right arrow
⇐&lArr;&#8656;&#x21D0;Double left arrow
⇒&rArr;&#8658;&#x21D2;Double right arrow

Accented letters

CharNamedDecimalHexDescription
é&eacute;&#233;&#xE9;e acute
è&egrave;&#232;&#xE8;e grave
ê&ecirc;&#234;&#xEA;e circumflex
ë&euml;&#235;&#xEB;e diaeresis
ü&uuml;&#252;&#xFC;u umlaut
ö&ouml;&#246;&#xF6;o umlaut
ñ&ntilde;&#241;&#xF1;n tilde
ç&ccedil;&#231;&#xE7;c cedilla
å&aring;&#229;&#xE5;a ring
ø&oslash;&#248;&#xF8;o slash
ß&szlig;&#223;&#xDF;Sharp s
æ&aelig;&#230;&#xE6;ae ligature

Capitalise the first letter for the capital: &Eacute; is É.

Escaping by context (preventing XSS)

Escape and unescape in code

LanguageEscapeUnescape
JavaScript (browser)Set element.textContent = s instead of innerHTMLnew DOMParser().parseFromString(s, 'text/html').body.textContent
Pythonhtml.escape(s)html.unescape(s)
PHPhtmlspecialchars($s, ENT_QUOTES, 'UTF-8')html_entity_decode($s, ENT_QUOTES, 'UTF-8')
JavaStringEscapeUtils.escapeHtml4(s) (Apache Commons Text)StringEscapeUtils.unescapeHtml4(s)
C# (.NET)WebUtility.HtmlEncode(s)WebUtility.HtmlDecode(s)
Gohtml.EscapeString(s)html.UnescapeString(s)
RubyCGI.escapeHTML(s)CGI.unescapeHTML(s)

Frequently asked questions

Which characters must be escaped in HTML?
& and < in text, plus the quote character inside quoted attributes. Escaping & < > " ' everywhere is the simple, safe rule.
What is the difference between &amp;nbsp; and a normal space?
&nbsp; is a non-breaking space: the line never breaks there, and several in a row don't collapse into one the way normal spaces do.
Is &amp;apos; valid HTML?
In HTML5 and XML, yes. HTML4 didn't define it, so &#39; is the safest way to write an apostrophe.
Do I need entities for é, © or emoji?
No, if your page is saved and served as UTF-8 (<meta charset="utf-8">). Type the characters directly. Entities are only needed for the special characters above, or when you can't type a character.
Does escaping HTML prevent XSS?
It prevents XSS when untrusted text goes inside elements or quoted attributes. It does not protect script blocks, event handlers, CSS or javascript: URLs — keep untrusted data out of those.
✓ Copied!