HTML Entity Encoder

Convert special characters, accents, symbols and emoji into named, decimal or hex HTML entities.

Runs in your browser

Text to encode

What to encode

Also encodes every character above ASCII (accents, symbols, emoji) so the text survives any charset.

Entity format

Characters without a common name fall back to decimal references.

Encoded HTML

Encoded text appears here as you type.

HTML entity reference

CharNamed (copy)DecimalHexDescription
invisible  No-break space
&&&Ampersand
<&#60;&#x3C;Less-than sign
>&#62;&#x3E;Greater-than sign
"&#34;&#x22;Double quote
'&#39;&#x27;Apostrophe (HTML5; use &#39; for HTML 4/email)
©&#169;&#xA9;Copyright
®&#174;&#xAE;Registered trademark
™&#8482;&#x2122;Trademark
…&#8230;&#x2026;Horizontal ellipsis
—&#8212;&#x2014;Em dash
–&#8211;&#x2013;En dash
‘&#8216;&#x2018;Left single quote
’&#8217;&#x2019;Right single quote / apostrophe
“&#8220;&#x201C;Left double quote
”&#8221;&#x201D;Right double quote
«&#171;&#xAB;Left guillemet
»&#187;&#xBB;Right guillemet
•&#8226;&#x2022;Bullet
·&#183;&#xB7;Middle dot
€&#8364;&#x20AC;Euro sign
£&#163;&#xA3;Pound sign
¥&#165;&#xA5;Yen sign
¢&#162;&#xA2;Cent sign
°&#176;&#xB0;Degree sign
±&#177;&#xB1;Plus-minus
×&#215;&#xD7;Multiplication sign
÷&#247;&#xF7;Division sign
−&#8722;&#x2212;Minus sign
≠&#8800;&#x2260;Not equal
≤&#8804;&#x2264;Less than or equal
≥&#8805;&#x2265;Greater than or equal
∞&#8734;&#x221E;Infinity
½&#189;&#xBD;One half
¼&#188;&#xBC;One quarter
¾&#190;&#xBE;Three quarters
²&#178;&#xB2;Superscript two
µ&#181;&#xB5;Micro sign
&#182;&#xB6;Pilcrow (paragraph)
§&#167;&#xA7;Section sign
†&#8224;&#x2020;Dagger
←&#8592;&#x2190;Left arrow
→&#8594;&#x2192;Right arrow
↑&#8593;&#x2191;Up arrow
↓&#8595;&#x2193;Down arrow
↔&#8596;&#x2194;Left-right arrow
⇒&#8658;&#x21D2;Double right arrow
♥&#9829;&#x2665;Heart suit
♠&#9824;&#x2660;Spade suit
✓&#10003;&#x2713;Check mark (HTML5)
☆&#9734;&#x2606;White star (HTML5)
é&#233;&#xE9;e with acute
è&#232;&#xE8;e with grave
à&#224;&#xE0;a with grave
ç&#231;&#xE7;c with cedilla
ñ&#241;&#xF1;n with tilde
ü&#252;&#xFC;u with umlaut
ö&#246;&#xF6;o with umlaut
ß&#223;&#xDF;Sharp s (eszett)
invisible&#173;&#xAD;Soft hyphen
invisible&#8194;&#x2002;En space
invisible&#8195;&#x2003;Em space
invisible&#8201;&#x2009;Thin space
invisible&#8205;&#x200D;Zero-width joiner

What are HTML entities?

An HTML entity — formally a character reference — is a piece of text that stands for a single character. It starts with & and ends with ;. Named references use a mnemonic such as &copy; for ©, decimal references give the Unicode code point in base 10 (&#169;), and hexadecimal references give it in base 16 (&#xA9;). All three produce exactly the same character in the browser.

Entities exist for two reasons. Some characters have special meaning in markup — < starts a tag and & starts an entity — so they must be encoded when they are meant as text. Others are simply hard to type or may not survive a system that mishandles character encodings: legacy CMS fields, old email pipelines or a database that is not set to UTF-8. Encoding those as references makes them pure ASCII and therefore indestructible.

This encoder works on Unicode code points, not UTF-16 units, so emoji and other characters outside the Basic Multilingual Plane are converted correctly: 😀 becomes &#128512; rather than two broken surrogate references. Choose how much to encode and in which format, then copy the result.

How to use the HTML Entity Encoder

  1. Type or paste your text, or click Sample to see accents, currency symbols, quotes and an emoji.
  2. Choose what to encode: only the five HTML-special characters, everything outside ASCII, or every character.
  3. Pick the format: named entities where a name exists (with a decimal fallback), decimal, or hexadecimal.
  4. Copy the encoded output. Use the reference table below to look up and copy individual entities.

Example

With Non-ASCII and Named selected, Café “Crème” — 5 € & 😀 is encoded as:

Caf&eacute; &ldquo;Cr&egrave;me&rdquo; &mdash; 5 &euro; &amp; &#128512;

Named, decimal or hex — which should you use?

  • Named entities are the most readable in source code (&nbsp;, &mdash;), but HTML5 defines only about 2,200 names, so most Unicode characters have none.
  • Decimal references work for every Unicode character and in every HTML and XML parser, which makes them the safest choice for XML feeds and email.
  • Hex references match the U+ notation used in Unicode charts, so U+2014 is simply &#x2014;.
  • For apostrophes this tool writes &#39; instead of &apos;: &apos; was added in HTML5 and is not recognised by HTML 4 parsers and some email clients.

When you do not need entities

If your page is served as UTF-8 (<meta charset="utf-8">, the default for WordPress and modern frameworks), you can type é, € or emoji directly. Only & and < in text, and the quote character used around an attribute value, must be escaped. For that narrower job — showing code in a post — the HTML Escape Tool is simpler.

Frequently Asked Questions

What is the difference between encoding and escaping HTML?

Escaping replaces only the characters that would be interpreted as markup (&, <, > and quotes), which is what you need to display code or insert user text safely. Encoding goes further and can convert any character — accents, symbols, emoji — into a reference. The Special only mode here is equivalent to escaping.

Does encoding protect against XSS?

Escaping & < > " ' prevents text from being parsed as HTML in element content and quoted attributes. It is not enough inside <script> blocks, event-handler attributes, unquoted attributes or URLs such as href="javascript:…", which need context-specific encoding. In application code, use your framework’s escaping rather than a manual step.

Why are emoji encoded as one reference instead of two?

Emoji such as 😀 (U+1F600) are stored in JavaScript as two UTF-16 surrogate units. Encoding those units separately produces invalid references like &#55357;&#56832;, which browsers render as replacement characters. This tool reads whole code points, so you get the correct single reference &#128512;.

Can I encode an email address to hide it from spam bots?

Choosing Everything turns each character into a numeric reference, which defeats the simplest scrapers. Browsers decode it instantly, and so do most modern harvesters, so treat it as a light deterrent rather than real protection.

How do I turn entities back into characters?

Paste the encoded text into the HTML Entity Decoder. It understands all named, decimal and hex references, including double-encoded text such as &amp;eacute;.