Skip to content
FizzKit

HTML Entity Encode / Decode

Encode special characters into HTML entities or decode entities back to text. Encoding presets cover the five markup-breaking characters, attribute-safe escaping, text-node escaping, every non-ASCII character, or everything; the entity style (named, decimal, hex) applies consistently, and existing entities are preserved so nothing is double-encoded. Decoding follows the HTML5 parser: all 2,125 named references, decimal and hex numeric references, legacy names without a semicolon and the Windows-1252 remap, with unknown or invalid references reported. A sanitised live preview shows how the output renders.

Runs locally in your browser
Paste a whole template, or open fullscreen for more room
Text or HTML
0 chars · 1 line
Encoded (Minimal, named)
Output will appear here…
Rendered outputEntities show as literal text. Scripts, event handlers and iframes are stripped by DOMPurify.
Nothing to render yet.
Preset
Style

The five characters that can break markup: & < > " '. What most template engines escape by default. Characters without a name fall back to a hex reference.

How to use HTML Entity Encode / Decode

  1. 1Pick Encode or Decode and paste your text or HTML — the output updates as you type.
  2. 2When encoding, choose a preset: Minimal (& < > " '), Attribute-safe, Text node, All non-ASCII or Everything, and pick named, decimal or hex references.
  3. 3Leave "Keep existing entities" on so text that already contains &amp; or &#169; is not encoded twice.
  4. 4When decoding, read the notices: unknown names, out-of-range numbers, legacy references without a semicolon and C1 remaps are all listed with the exact reference.
  5. 5Check the rendered preview (sanitised with DOMPurify) to see how a browser would display the output, then copy or download.

About HTML Entity Encode / Decode

Encode special characters into HTML entities or decode entities back to text. Encoding presets cover the five markup-breaking characters, attribute-safe escaping, text-node escaping, every non-ASCII character, or everything; the entity style (named, decimal, hex) applies consistently, and existing entities are preserved so nothing is double-encoded. Decoding follows the HTML5 parser: all 2,125 named references, decimal and hex numeric references, legacy names without a semicolon and the Windows-1252 remap, with unknown or invalid references reported. A sanitised live preview shows how the output renders.

HTML Entity Encode / Decode is part of FizzKit — a collection of focused developer and ad-tech tools. Because everything runs locally, it works offline once loaded and never exposes your data to a remote server.

Frequently asked questions

Whenever untrusted text is rendered into HTML. Encoding & < > " and ' neutralises tags and attribute break-outs, which is the first line of defence against XSS.