Developer ToolsA little help for every day

Search by name or task, such as JSON or percentage.

Developer Tools

HTML Entity Encoder and Decoder

Escape & < > and quotes as &amp;, &lt; and &quot;, or turn £ and © into &pound; or &#xA9;. Decodes 250+ named entities and every numeric entity.

View all tools
ResultUpdates as you type
&lt;p class=&quot;tip&quot;&gt;Price &lt; £100 &amp; free delivery © 2026&lt;/p&gt;

Encoded 8 characters.

How to use HTML Entity Encoder and Decoder

Paste HTML or plain text and choose Encode or Decode. When encoding, pick which characters to convert and the entity style; the result updates as you type and reports how many characters or entities were converted.

  1. Paste HTML or textEnter a code snippet or user text to escape, or text full of entities such as &pound; and &#163; to decode.
  2. Set scope and styleChoose special characters only, all non-ASCII, or every character, then named (&copy;), hex (&#xA9;) or decimal (&#169;).
  3. Copy the outputUntick Encode quotes for body text, then copy the result. In decode mode any unrecognised entities are listed.

Choosing what to encode

The default scope converts only the five characters that matter in HTML markup: & < > and both quote marks, giving &amp;, &lt;, &gt;, &quot; and &#39;. That is enough for showing code samples or user input safely on a page; untick Encode quotes if the text is not going inside an attribute value. Special characters + all non-ASCII also converts symbols and accented letters, so £ becomes &pound; and © becomes &copy; in the named style, or &#xA3; and &#xA9; in hex. Every character except whitespace turns letters into entities too: a@b.com becomes &#97;&#64;&#98;&#46;&#99;&#111;&#109; in decimal.

How entities are decoded

Decoding recognises more than 250 common named entities, from &amp; and &nbsp; to &mdash;, &hellip; and the Greek letters, plus every decimal and hexadecimal numeric form such as &#163; and &#xA3;. As the HTML standard requires, numbers 128 to 159 are read as Windows-1252, so &#150; becomes an en dash (–), and invalid code points become �. In the browser the remaining HTML5 named entities are recognised as well. Anything still unknown, such as a misspelt &foo;, is left exactly as it is and listed in a warning so you can fix it.

Accuracy and data handling

Validate the result with your project's own tests and runtime rules before using it in production. The calculation runs in your current browser; the tool code does not send the input to a processing API.

Often Used Together

Next step

FAQ

What is the difference between &#39; and &apos;?

Both mean a single quote. &apos; was not part of HTML 4, so the encoder writes the more widely supported &#39;, while the decoder understands both.

Do I need to encode accented letters or £ signs?

Not if the page is served as UTF-8, as almost all are. Convert them only when the output must be pure ASCII, for example in some email templates or older systems.

Why was an entity not decoded?

It may be misspelt, missing its closing semicolon, or not a real HTML entity. The decoder leaves such sequences unchanged and lists them so you can check each one.

More Developer Tools

Related tools