HTML Entities Encoder & Decoder

Escape text so it displays safely inside HTML, or turn entity codes back into characters.

Common HTML entities

&&&
<&lt;&#60;
>&gt;&#62;
"&quot;&#34;
'&apos;&#39;
␣&nbsp;&#160;
©&copy;&#169;
®&reg;&#174;
™&trade;&#8482;
…&hellip;&#8230;
—&mdash;&#8212;
–&ndash;&#8211;
€&euro;&#8364;
£&pound;&#163;
¥&yen;&#165;
¢&cent;&#162;
°&deg;&#176;
×&times;&#215;
÷&divide;&#247;
←&larr;&#8592;
→&rarr;&#8594;
↑&uarr;&#8593;
↓&darr;&#8595;
♥&hearts;&#9829;
«&laquo;&#171;
»&raquo;&#187;
‘&lsquo;&#8216;
’&rsquo;&#8217;
“&ldquo;&#8220;
”&rdquo;&#8221;
&para;&#182;
§&sect;&#167;
·&middot;&#183;
•&bull;&#8226;
±&plusmn;&#177;
½&frac12;&#189;

Questions people ask

Which characters must be escaped in HTML?

Inside text, escape & as &amp; and < as &lt;. Inside attribute values, also escape the quote you used: &quot; or &#39;. Escaping > as &gt; is optional but common. Failing to escape user input is the root cause of cross-site scripting (XSS).

What is the difference between named and numeric entities?

Named entities such as &copy; are easier to read; numeric ones such as &#169; (decimal) or &#xA9; (hex) work for every Unicode character. With UTF-8 pages you rarely need either except for the few special characters above.

What is &nbsp;?

A non-breaking space (U+00A0). It looks like a space but prevents a line break between the words on either side, for example “10&nbsp;km”.

Related tools