HTML Encoder / Decoder
Convert characters to HTML entities and back.
To show a literal <div> on a page instead of having the browser render it, the angle brackets must be escaped into entities. This converter escapes any text into safe HTML — and reverses the process when you need to read encoded markup back.
Why it matters
- Display code samples and tags on a page without the browser executing them.
- Sanitise user-supplied strings before they are written into HTML.
- Decode entity-laden content pulled from a feed or database for review.
Escaping output is also a first line of defence against cross-site scripting, so it is worth doing habitually.