99tools

HTML Entity Encoder & Decoder

runs in your browser

Encode text for HTML, escaping only what breaks markup or as much as you need, decode entities back, and look up the ones you can never remember.

Mode

Only the characters that can break markup: & < > " ' and the backtick. The right default for a UTF-8 page.

Text

Encoded

Common entities

40 shown
CharacterNamedNumericWhat it is
&&#38;Ampersand
<&#60;Less than
>&#62;Greater than
"&#34;Double quote
'&#39;Apostrophe, XML only
space&#160;Space that never wraps
&#8211;En dash, for ranges
&#8212;Em dash
&#8216;Left single quote
&#8217;Right single quote, apostrophe
&#8220;Left double quote
&#8221;Right double quote
&#8230;Ellipsis
©&#169;Copyright
®&#174;Registered
&#8482;Trademark
°&#176;Degree
±&#177;Plus or minus
×&#215;Multiplication
÷&#247;Division
½&#189;One half
&#8364;Euro
£&#163;Pound
¥&#165;Yen
¢&#162;Cent
§&#167;Section
&#182;Paragraph
&#8224;Dagger
&#8226;Bullet
&#8592;Left arrow
&#8594;Right arrow
&#8593;Up arrow
&#8595;Down arrow
&#8804;Less than or equal
&#8805;Greater than or equal
&#8800;Not equal
&#8734;Infinity
α&#945;Greek alpha
β&#946;Greek beta
π&#960;Greek pi

about this tool

Escape less, not more

Only a handful of characters can break HTML: the ampersand, the angle brackets, the two kinds of quote and the backtick. Everything else is safe to write as itself, because documents have been UTF-8 for years.

Older tools encode every accented letter and symbol out of habit. That was necessary when a page might be served in Latin-1 and a stray é would arrive as mojibake. Today it makes the source unreadable and the file bigger for no gain, which is why the default here escapes only what has to be escaped.

The wider modes are still there for the cases that need them: an email template going through a system with unknown encoding, or a field that will be handled by software you do not control.

Named or numeric

A named reference such as &mdash; is readable. A numeric one such as &#8212; works everywhere, including in XML, which defines only five names of its own. If the output is going into an XML document rather than HTML, prefer numeric for anything beyond those five.

A quirk worth knowing

A few entities are recognised without their closing semicolon, for compatibility with very old markup. &not is one of them, which means &notanentity; does not decode as a broken entity: it becomes a not sign followed by anentity;. Decoding here follows the same rule a browser does, so what you see is what a browser would render.

Turn on strict decoding to refuse malformed input instead. Left off, anything shaped like an entity that is not one is passed through unchanged and reported underneath, so nothing disappears silently.