Decode accepts named entities (<, &) and numeric forms (<, <). Encode escapes & < > quotes so markup can be shown as text.
Help Us Improve
—
(—)
HTML decoder & encoder
Decode HTML entities back to readable markup, or encode <, >, &, and quotes. Local-first. No signup.
What is an HTML decoder?
HTML decoder features
HTML decode
Turn named and numeric entities back into readable text.
HTML encode
Escape &, <, >, and quotes so markup can be shown as text.
Named or numeric
Encode as <, <, or <.
Full named set
Decode uses the WHATWG named character reference table.
How to decode HTML entities
Paste encoded HTML
Drop in a string that contains <, &, or numeric references.
Read the decode
The output updates as you type—no submit step.
Encode the other way
Switch mode to escape characters before embedding HTML in a page or JSON string.
Tips for HTML encode / decode
- 01
Decode once per layer
Double-encoded text (&lt;) needs two passes to become <.
- 02
Encode before innerHTML
Escape user text so < and & are not treated as markup.
- 03
URL encoding is separate
Percent-encoding (%20) is a URL job—use URL Encoder for that.
- 04
Keep newlines
Tabs and line breaks stay as-is unless you also encode non-ASCII.
Great for
Escaped snippets
Read HTML that was stored as entities in a CMS or email.
Safe display
Encode a fragment before placing it in a page as text.
Debugging markup
See whether a string is still entity-encoded.
Why decode HTML here
Local-first
Text never leaves the browser for this tool.
Free
Unlimited encode and decode with no signup.
Both directions
HTML decoder and encoder in one place.
Spec names
Named entities follow the WHATWG character reference list.
Technical notes
- Decode
- Named references from the WHATWG table, plus &#decimal; and &#xhex;.
- Encode
- Escapes & < > " ' as named, decimal, or hex entities.
- Non-ASCII
- Optional extra pass encodes code points above 126 as numeric references.
- Privacy
- Client-side only—no network upload.
Sources & References
“This table lists the character reference names that are supported by HTML, and the code points to which they refer. It is referenced by the previous sections.”
WHATWG — Named character references: Source of the named entity table this decoder uses (semicolon form). html.spec.whatwg.org/multipage/named-characters.html
“The term "HTML Entity" is used as a synonym for a character reference — a pattern of characters that can represent another character in the HTML.”
MDN — Entity: Defines the entity syntax (&name;) that encode and decode operate on. developer.mozilla.org/en-US/docs/Glossary/Entity
“In HTML, a character entity reference is a construct that consists of an ampersand, followed by the name of a character, followed by a semicolon.”
Wikipedia — Character entity reference: Background on named versus numeric character references in HTML. en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references