Productive Toolbox

HTML Entity Encoder / Decoder

Encode special characters as HTML entities (named, decimal or hex) and decode entities back to text, with a reference table of common entities.

Input

44 characters

Output

70 characters7 entities

Settings

✓ Detected: Encoding

History (Last 20)

What HTML Entities Are and When to Use Them

A browser reads < as the start of a tag and & as the start of an entity, so those characters cannot appear as plain text in HTML. An HTML entity writes such a character as a code the browser displays but never treats as markup.

Named:   &name;    &lt; &eacute; &euro;

Decimal: &#number;   &#60; &#233; &#8364;

Hex:     &#xhex;    &#x3C; &#xE9; &#x20AC;

The number in a numeric reference is the character's Unicode code point, so every character, including emoji, has one. Only about 2,200 characters have a name, and names are case-sensitive: &Eacute; is É and &eacute; is é.

On a modern page saved as UTF-8, you only need to escape & and < in text, plus the quote character that wraps an attribute value. Typing é, € or — directly is fine and easier to read; entities for them are for older systems, some email templates, and places where the source must stay plain ASCII.

Common HTML Entities Chart

CharNamedDecimalHexMeaning
&&amp;&#38;&#x26;Ampersand (must be escaped)
<&lt;&#60;&#x3C;Less-than sign (must be escaped)
>&gt;&#62;&#x3E;Greater-than sign
"&quot;&#34;&#x22;Double quote (in attributes)
'&#39;&#39;&#x27;Apostrophe (&apos; in HTML5)
(space)&nbsp;&#160;&#xA0;Non-breaking space
©&copy;&#169;&#xA9;Copyright sign
®&reg;&#174;&#xAE;Registered trademark
™&trade;&#8482;&#x2122;Trademark
€&euro;&#8364;&#x20AC;Euro sign
£&pound;&#163;&#xA3;Pound sign
¥&yen;&#165;&#xA5;Yen sign
¢&cent;&#162;&#xA2;Cent sign
°&deg;&#176;&#xB0;Degree sign
±&plusmn;&#177;&#xB1;Plus-minus
×&times;&#215;&#xD7;Multiplication sign
÷&divide;&#247;&#xF7;Division sign
½&frac12;&#189;&#xBD;One half
–&ndash;&#8211;&#x2013;En dash (ranges: 9–5)
—&mdash;&#8212;&#x2014;Em dash
…&hellip;&#8230;&#x2026;Ellipsis
“ ”&ldquo; &rdquo;&#8220; &#8221;&#x201C; &#x201D;Curly double quotes
‘ ’&lsquo; &rsquo;&#8216; &#8217;&#x2018; &#x2019;Curly single quotes
« »&laquo; &raquo;&#171; &#187;&#xAB; &#xBB;Guillemets (French, German quotes)
•&bull;&#8226;&#x2022;Bullet
→&rarr;&#8594;&#x2192;Right arrow
≤ ≥&le; &ge;&#8804; &#8805;&#x2264; &#x2265;Less / greater than or equal
é&eacute;&#233;&#xE9;e with acute accent
ü&uuml;&#252;&#xFC;u with umlaut
ñ&ntilde;&#241;&#xF1;n with tilde
ß&szlig;&#223;&#xDF;German sharp s
😀—&#128512;&#x1F600;Emoji (numeric references only)

Escaping in Practice

  • Showing code on a page: <div class="box"> must be written as &lt;div class=&quot;box&quot;&gt; inside a <pre> or <code> block, or the browser will render an actual div.
  • Attribute values: in title="Say &quot;hi&quot;" the inner quotes must be escaped, or they end the attribute early.
  • Double escaping: text that shows &amp; or &lt; on screen was escaped twice, often once by a CMS and once by a template. Decode it one level at a time here to find where it happened.
  • Security: escaping stops user text from being read as HTML, but JavaScript, URLs and CSS need their own escaping. Frameworks such as React, Vue and Django escape text for you; avoid bypasses like dangerouslySetInnerHTML for user input.

How to Use the HTML Entity Encoder

  1. 1Paste your text: Paste HTML, code or text into the input box; a sample is loaded so you can see the result straight away.
  2. 2Choose a mode: Pick Encode to turn characters into entities, Decode to turn entities back into characters, or Auto to let the tool decide from the text.
  3. 3Pick the entity format: Choose named entities (&lt;), decimal references (&#60;) or hexadecimal references (&#x3C;), and tick the option to also encode accented letters, symbols and emoji if your page or email is not UTF-8.
  4. 4Copy the result: Copy the converted text or export it as a TXT file; conversions you copy or export are kept in the history for later.

Frequently Asked Questions

What is an HTML entity?

A code that stands for a character in HTML. It starts with & and ends with a semicolon: &lt; is <, &amp; is &, and &copy; is ©. Browsers show the character, but the code itself cannot be mistaken for markup.

Which characters must be escaped in HTML?

The ampersand (&) and the less-than sign (<) in text, and quotes inside attribute values (" as &quot;, ' as &#39;). Escaping > as &gt; is not required but is common practice. All other characters can be written as they are on a UTF-8 page.

What is the difference between named, decimal and hex entities?

They are three ways to write the same character. Named entities use a word (&eacute;), decimal references use the Unicode code point in base 10 (&#233;) and hex references use it in base 16 (&#xE9;). Every character has a numeric reference, but only some have a name.

What does &nbsp; mean?

A non-breaking space (U+00A0). It looks like a normal space but keeps the words on either side on the same line, for example between a number and its unit (10&nbsp;kg), and it is not collapsed when several are written in a row.

Do I need to encode accented letters like é or symbols like €?

Not on a page saved and served as UTF-8, which is the standard today: write é and € directly. Encode them only for systems that use another character set, some older email clients or when you must keep a file pure ASCII.

Why does &amp;lt; show as &lt; instead of <?

Because it was encoded twice: & became &amp; and the result was encoded again. Decoding once gives &lt;, and decoding again gives <. This tool decodes exactly one level, so you can see and fix double-escaped text.

Does encoding HTML entities protect against XSS?

Escaping text before putting it into HTML is one essential layer, but safety depends on the context: text in a <script> block, a URL or a CSS value needs different escaping. Use your framework's built-in escaping or a sanitizer for user input rather than escaping by hand.

Is my data private?

Yes. We do not collect or store what you enter. Any history the tool keeps is visible only to you.