What HTML entities are and why they exist
HTML gives special meaning to a handful of characters: < starts a tag, & starts an entity, and quotes delimit attribute values. To display those characters literally — or to insert untrusted text without letting it become markup — you replace them with entities: <, &, ". That substitution is the single most important defence against cross-site scripting, which is why every template engine escapes by default.
This tool encodes the five HTML-critical characters plus every non-ASCII character, preferring well-known named entities such as ©, — and € and falling back to hex numeric references like →. The decoder reverses all of it — around thirty common named entities plus any decimal or hex numeric entity. Everything runs locally in your browser.
How to encode or decode HTML entities
- Pick Encode or Decode at the top of the panel.
- Paste your text or markup into the input.
- Click the convert button and copy the result.
Entities vs other encodings
Entity encoding is context-specific: it protects text inside HTML, and nothing else. Data going into a query string needs the URL Encoder instead, and binary payloads travel as Base64. Modern UTF-8 pages rarely need entities for accented letters or emoji — those can appear literally — so in practice you escape the structural five (& < > " ') everywhere, and reach for the rest when a document must survive an ASCII-only pipeline.