HTML entity encode/decode · Guide
HTML Entities Encoder and Decoder Online
HTML entity encoding replaces characters like < and & with safe entity codes so they display as text instead of being parsed as markup. This guide explains when to encode and decode.
Why escape HTML
Characters such as <, >, & and quotes have structural meaning in HTML. To show them literally — or to safely insert user text — you encode them as entities like < and &, which the browser renders as the original characters.
This tool encodes and decodes common entities in the browser, so content never leaves your machine.
Encode or decode
Encoding makes text safe to drop into HTML; decoding turns entity codes back into readable characters for inspection or editing.
Frequently asked questions
Does encoding HTML entities prevent XSS?
Proper output encoding is a key defence against XSS, but it must be applied in the right context. Treat this tool as a helper for understanding and inspecting entities, not a complete security solution.
Ready to try it?
Open the free browser-based HTML entity encode/decode and apply what you just read — no sign-up, runs locally.
Open the HTML entity encode/decode tool