HTML Entity Encoder and Decoder
Convert text locally under the WHATWG HTML Standard's character-reference rules: encoding escapes just the mandatory five or every non-ASCII character as well, and decoding comes with a per-replacement change list and an unresolved list. Decoding shows you what the text says — it does not make markup safe to insert, and encoding text for display is not sanitisation. Semicolon-less legacy references (such as & without the semicolon) are not supported and stay literal.
Convert
The output still contains a decodable reference — it looks double-encoded.
Change list
| Position | Source | Result | Rule |
|---|
Unresolved
| Position | Token | Reason |
|---|
How it works and its limits
- The named table is the complete WHATWG named character reference set (2,231 entries, 2,125 of them semicolon forms), vendored as a data file; its source and hashes are recorded in the repo's PROVENANCE.md. Decoding only ever looks up the semicolon forms.
- Numeric references follow the Standard: value 0, the surrogate range and anything above U+10FFFF become the replacement character U+FFFD, and 0x80–0x9F go through the C1 remapping table. A numeric reference missing its semicolon still converts, flagged in the change list.
- Change-list positions are code-point indices, not UTF-16 units, so astral characters do not shift later positions. The list renders at most the first 500 rows with the total shown; the conversion itself is never capped by the display cap.
- Input is capped at 100,000 characters; beyond that it is refused with the count shown, never silently truncated.
- Input and output render as text only and are never parsed as markup; nothing is stored and nothing is sent anywhere.