How to encode and decode HTML entities
- Choose Encode or Decode. Encode escapes characters for safe HTML insertion; Decode converts entities back to plain text.
- Choose Essential or All chars mode (encode only). Essential encodes the five critical characters —
& < > " '. All chars additionally encodes accented letters, symbols, and emoji as numeric entities. - Paste your text or HTML. The result appears instantly.
- Use Swap to round-trip the output back through the tool.
Essential HTML entities reference
| Character | Entity | Numeric | Why it matters |
|---|---|---|---|
| & | & | & | Starts all entities — must be encoded first |
| < | < | < | Opens HTML tags — raw < breaks markup |
| > | > | > | Closes HTML tags |
| " | " | " | Delimits attribute values in double quotes |
| ' | ' | ' | Delimits attribute values in single quotes |
| © | © | © | Copyright — commonly needed |
| — | — | — | Em dash — often pasted as a raw character |
| … | … | … | Ellipsis — three dots as one glyph |
When to use each mode
Essential mode is correct for the vast majority of use cases. Encoding the five critical characters is sufficient to prevent HTML injection, XSS, and layout breakage when inserting user-generated content into HTML.
All chars mode is useful for generating HTML email that must render correctly in old email clients that do not support UTF-8, or for embedding text in HTML documents with a non-UTF-8 charset declaration. Modern browsers handle UTF-8 natively so raw Unicode in HTML is fine.
Related tools: URL Encoder for percent-encoding URLs, Base64 Encoder for binary-to-text encoding, or the JSON Formatter to validate and format JSON.