Skip to content
Esc

HTML entity encoder

Escape and unescape HTML entities like & and <.

Escapes & < > " ' — enough for HTML text and attribute values in a UTF-8 page.

Try

About this tool

Runs in
your browser
Your input sent to our servers
Nothing
Kept on this device
nothing

More in the privacy policy.

How to use it

  1. 01Choose Encode or Decode, then type or paste your text or HTML. Or pick one under Try.
  2. 02For encoding, choose Special characters (enough for a UTF-8 page) or Special and non-ASCII, in decimal or hex.
  3. 03Copy the result, or press Swap to run it back the other way.

Related tools

Questions

Which characters need encoding?

In HTML text and in quoted attribute values, five: & < > " and ', written as &amp;, &lt;, &gt;, &quot;, &#39;. In a UTF-8 page every other character can stay as it is.

When do I need non-ASCII as numbers?

When the page or the system that stores it isn’t UTF-8, such as an old database or an email template. Every character above ~ becomes a numeric reference: é is &#233; in decimal or &#xE9; in hex, and an emoji is a single reference.

Which entities does Decode understand?

All of them: every named entity in the HTML standard, decimal and hex references, and the legacy forms browsers accept, such as &copy without a semicolon. It uses your browser’s own HTML parser, so it decodes exactly as a browser does for text on a page. Tags in the text are left as they are, and nothing in it runs. Inside attribute values browsers are stricter: in a link such as ?a=1&not=2, “&not” stays as written there but decodes to ¬ here.

Is my text sent anywhere?

No. It’s converted in your browser as you type. It isn’t sent to our servers, put into the page address or saved.