HTML Encoder / Decoder
Escape HTML entities for display, or decode them back.
What gets escaped
| Character | Entity |
|---|---|
& | & |
< | < |
> | > |
" | " |
' | ' |
Runs entirely in your browser. Nothing you paste or upload leaves your device.
How to use the HTML encoder / decoder
- Paste HTML or text into the Input box, or press “Sample”.
- Press “Encode” to escape it, or “Decode” to turn entities back.
- Copy or download the result.
HTML encoder / decoder example
The text <b>Tom & "Jerry"</b> encodes to <b>Tom & "Jerry"</b>, which a browser shows as text instead of bold markup.
When to encode
- Showing user-submitted text on a web page (prevents HTML injection).
- Putting code samples into a blog post.
- Writing attribute values that contain quotes.
HTML encoder / decoder: common questions
- What does encoding do?
- It turns characters such as <, > and & into HTML entities (<, >, &) so the text displays as text instead of being read as HTML.
- When would I use this?
- When showing code on a web page, or when putting user text into HTML safely.
- Is my input uploaded?
- No. Encoding and decoding happen in your browser.
- Does encoding protect against all XSS?
- It is the main defence for HTML text, but content inside scripts, URLs and CSS needs its own escaping rules.