HTML Entity Encoder / Decoder
Show code samples on a web page, put text into HTML attributes safely, or read text full of & and ' entities.
Runs entirely in your browser. Your input and files are not uploaded to any server.
How to use
- Paste text or HTML.
- Choose Encode or Decode.
- For encoding, optionally convert every non-ASCII character to a numeric entity.
- Copy the result.
Examples
<div class="x"> → <div class="x">
Tom & Jerry's → Tom & Jerry’s
Privacy
Runs entirely in your browser. Your input and files are not uploaded to any server. See the privacy policy for what is stored in your browser (favorites and history only). Privacy policy
Check it yourself: open your browser’s developer tools, select the Network tab and use the tool. Your file never appears in an upload request. Once this page is saved for offline use, you can also disconnect from the internet and keep working. Ads and anonymous visit statistics, when enabled, make their own requests, but they never receive your files or text.
Frequently asked questions
Is escaping enough to prevent XSS?
Escaping text before inserting it into HTML element content or quoted attributes prevents it from being interpreted as markup. It is not enough for JavaScript, CSS or URL contexts, which need their own encoding.
Does decoding run the HTML?
No. Decoding uses an inert parser and returns plain text.