HTML Encoder / Decoder
Escape and unescape HTML entities such as <, > and &.
Output
About the HTML Encoder / Decoder
When you need to show HTML code on a page rather than render it, the angle brackets, quotes and ampersands must be replaced with entities. This tool converts in both directions.
Escaping user-supplied content before inserting it into HTML is also the simplest defence against cross-site scripting.
How to use the HTML Encoder / Decoder
- Choose Encode to escape markup, or Decode to turn entities back into characters.
- Paste your snippet into the input box.
- The result appears immediately.
- Copy the output.
Examples
| Input | Result |
|---|---|
| <a href="/">Home</a> | <a href="/">Home</a> |
| <p>Hi</p> | <p>Hi</p> |
| Fish & Chips | Fish & Chips |
Frequently asked questions
Which characters are escaped?
The five that matter in HTML: & < > " and '. Everything else is left untouched so text stays readable.
Is my data sent to a server?
No. This tool runs entirely in your browser using JavaScript. Nothing you enter is uploaded, logged or stored by AHRATOOLS.
Is the tool free to use?
Yes. Every AHRATOOLS tool is free, requires no account and has no usage limits.

