HTML Entity Encoder/Decoder
Convert characters like &, <, >, ", and ' to their safe HTML entity form, or reverse the process to read entity-encoded text.
Overview
A handful of characters are structurally meaningful in HTML — < and > open and close tags, & starts an entity, and quotes delimit attribute values. Text containing any of them has to be escaped before it's embedded in an HTML document, or the browser will misinterpret it as markup instead of literal text. This tool escapes the five characters that matter for that purpose (&, <, >, ", '), and decodes them back, including numeric character references like ' and '.
Examples
Encoding
<script>alert('hi')</script>
<script>alert('hi')</script>
Decoding
Tom & Jerry's "Adventure"
Tom & Jerry's "Adventure"
How It Works
- Paste your text into the input box.
- Choose Encode or Decode.
- Click Convert to see the result.
Tips
- This tool covers the basic 5 named entities (& < > " ') plus numeric character references — it doesn't decode the full named-entity set (like or ©), since that's a much larger dictionary aimed at a different use case than escaping user text for safe embedding.
FAQ
No. Encoding and decoding happen entirely in your browser using a plain JavaScript character map — nothing you type ever leaves your device.
No. Escaping these characters prevents text from being misinterpreted as markup, but a full sanitizer (for handling untrusted HTML input, not plain text) needs to do more than character-level escaping.
The five basic named entities (& < > " '/') and any numeric character reference (' or ' style). An unrecognized named entity like produces an error rather than being silently passed through or guessed at.
It's returned unchanged — decoding is a no-op on plain text with nothing to decode.