Mr. Encoder

HTML Entity Encoder / Decoder

Escape special characters as HTML entities or decode named, decimal and hexadecimal entities back to text.

How to use

  1. Paste the text, HTML snippet or entity-encoded string into the input box.
  2. To encode, optionally enable numeric entities for non-ASCII characters, then click Encode.
  3. Click Decode to turn named, decimal and hex entities back into characters, then copy the output.

Frequently asked questions

What are HTML entities?

HTML entities are text sequences such as <, & or © that represent characters which would otherwise be interpreted as markup or are hard to type. The browser displays them as the actual characters.

Which characters must be escaped in HTML?

In text and attribute values you should escape & as &amp;, < as &lt;, > as &gt;, " as &quot; and ' as &#39;. Escaping these prevents broken markup and is a key defence against XSS when inserting user input into a page.

When should I encode non-ASCII characters as numeric entities?

Modern UTF-8 pages can contain characters like ç, € or emoji directly. Numeric entities such as &#231; are useful when the target system, email template or legacy file only supports ASCII.

Which entities can this tool decode?

It decodes all named HTML5 entities (like &nbsp;, &euro;, &hellip;) using the browser's own parser, plus decimal (&#8364;) and hexadecimal (&#x20AC;) numeric entities. Decoding is done in a single pass, so &amp;lt; correctly becomes &lt; rather than <.

Other tools