Skip to main content
ZEKILO Dev

HTML Entity Encoder

Turn HTML special characters into entities, or turn entities back into characters.

Stays in your browserHTML Living StandardAs of 2026.10.03

Text

Press Esc, then Tab to leave the editor.

Escaped

How to use HTML Entity Encoder

  1. 1Choose a direction (Encode or Decode), then paste text into the input panel or press Sample.
  2. 2When encoding, choose which characters to convert (Minimal or Also non-ASCII) and the numeric format. The result updates as you go.
  3. 3Press Copy to copy the result or Download to save it. Swap moves the result to the input and reverses the direction.

HTML Entity Encoder options

Direction
Encode (escape) turns special characters into entities. Decode turns entities back into characters.
Characters
Minimal (default) converts only five characters: & < > and the double and single quotes. Also non-ASCII converts characters outside ASCII, such as Korean, Japanese, and emoji, to numeric entities as well. This applies to encoding only.
Numeric format
How non-ASCII characters are written. Hex (default) writes &#xC81C; and Decimal writes &#51228;.

HTML entities and how this tool behaves

In HTML, &, <, and > are part of the syntax, so to use them as content you write character references (entities) such as &amp;, &lt;, and &gt;. Inside attribute values the quotes (" and ') are written as &quot; and &#39; as well. When encoding, Minimal converts only these five characters. Also non-ASCII converts characters outside ASCII, such as Korean, Japanese, and emoji, to numeric entities like &#xC81C;. A numeric entity is written as one Unicode code point, not as a UTF-16 surrogate pair.

Decoding reads every named entity in the named character references of the HTML standard and decimal and hex numeric entities. It follows the same rules a browser uses for text, so a legacy name without a semicolon such as &copy is decoded, and a name that is not in the list, such as &unknown;, is left as it is.

Entities are decoded once

Decoding &amp;lt; gives &lt;. &amp; becomes &, and the characters that remain are not decoded again. When text has been escaped several times it is easy to lose track of how many levels are left. This tool removes exactly one level each time.

HTML Entity Encoder examples

  • Escape an HTML tag (defaults: Encode, Minimal)

    Input

    <a href="x">Tom & Jerry's</a>

    Output

    &lt;a href=&quot;x&quot;&gt;Tom &amp; Jerry&#39;s&lt;/a&gt;
  • Decode entities

    Direction: Decode. Entities are decoded once, so &amp;lt; becomes &lt; and not <.

    Input

    &copy; &#x1F600; &amp;lt;

    Output

    © 😀 &lt;
  • Korean text as numeric entities (Also non-ASCII, Hex)

    Input

    제킬로

    Output

    &#xC81C;&#xD0AC;&#xB85C;

Examples use the reference cases this tool is tested against.

HTML Entity Encoder: frequently asked questions

Is my input sent to a server?

No. Your input and the result are processed only in this browser and are not stored. Reloading the page clears them.

Which characters must be escaped in HTML?

& < > and, inside attribute values, the double and single quotes. The Minimal setting turns these five into &amp; &lt; &gt; &quot; &#39;. If text typed by a user goes into HTML without converting them, the text can be read as tags or attributes.

What is the difference between named and numeric entities?

A named entity refers to a character by name, such as &copy;. A numeric entity refers to it by Unicode code point, such as &#169; (decimal) or &#xA9; (hex). The character shown is the same. Numeric entities work for every character and are also valid in XML.

Why does &amp;lt; decode to &lt; and not <?

Decoding happens once. &amp; becomes &, which leaves the characters &lt; behind, and they are not decoded again. A browser reading HTML does the same. To go one level further, put the result back into the input.

Is the decoded result run as HTML?

No. The result is shown as plain characters in a text box. It is not read as tags and no script is run. Text that looks like a tag stays text.

How it works · Standards

  • Processed in: this browser (your device). Nothing is sent or stored.
  • Standards: HTML Living Standard
  • Engine: ZEKILO Dev escaper (encoding) (in-house code) · entities 8.1.0 (decoding) (BSD-2-Clause)
  • The single quote is always written as &#39;, whatever the numeric format is.
  • Decoding follows the HTML standard, so legacy names without a semicolon (such as &copy and &amp) are decoded too.
  • As of 2026.10.03
  • Changelog: 2026.10.03 First release
Open-source licenses →
Something wrong with the result? Report an issue(Your input is not attached)