HTML Entity Encoder
Encode special characters as HTML entities (&, <, etc.) so they display safely in HTML, or decode entity sequences back to plain text. Uses a textarea so we don’t interpret HTML.
Encode or decode
Enter text and click Process.
How it works
Encode: we replace &, <, >, ", ' (and optionally more) with their entity form. Decode: we use a temporary DOM node and innerHTML to decode named and numeric entities.
When to use it
Use when inserting user input into HTML to avoid XSS, or when you have entity-encoded text and need the raw characters.
Frequently asked questions
- All characters? We encode the main ones (&<>"'). For full encoding you can use numeric entities for every character.