Skip to main content

HTML Entity Encoder / Decoder

Switch between two modes in your browser.

Encoding text is not the same as sanitizing untrusted HTML. Decoded output is shown as plain text and is not executed.

Encode escapes only the five HTML-sensitive characters (& < > " ') and leaves all other Unicode untouched, so encoding text that already contains entities double-encodes it (& becomes &amp;). Decode handles named, decimal, and hexadecimal HTML character references.

Processed locally in your browser

How to use it

  1. Choose a mode: Encode text to HTML entities, or Decode HTML entities back to characters
  2. Type or paste your text into the input box
  3. Click the Encode or Decode button to get the result
  4. Copy the result, or switch modes and Clear to start again

Encode escapes the five HTML-sensitive characters — & < > " ' — turning markup such as <a> into text that is safe to place inside HTML, while every other character, including accents, CJK, and emoji, is left exactly as typed. Decode does the reverse for HTML character references: named entities such as &copy; and &nbsp;, decimal references such as &#169;, and hexadecimal references such as &#xA9;, all resolved to their real Unicode characters. Encoding treats the input as raw text, so a string that already contains &amp; is double-encoded to &amp;amp; — this is expected, not a bug. Unknown names and malformed numeric references are left as they are or handled with the browser's HTML rules, never guessed at. Everything runs locally; nothing is uploaded or stored. Decoded output is shown as plain text in a read-only box and is never rendered or executed, and encoding text is not a substitute for sanitizing untrusted HTML. This is different from a URL Encoder, which applies percent-encoding for links, and from a Base64 Encoder, which encodes bytes or text into an ASCII alphabet.

FAQ

We use cookies to run this site and, with your consent, to understand usage and personalize ads. You can change your choice at any time.