HTML Encode/Decode
Convert special characters into HTML entities so code displays safely, or turn entities back into readable characters.
About this tool
HTML Encode/Decode is the browser equivalent of PHP's htmlspecialchars() and html_entity_decode(). Encoding makes text safe to display inside HTML without being interpreted as markup, which is the basic defence against XSS; decoding recovers readable text from scraped pages, feeds and APIs that double-escape content.
Related: URL Encode/Decode.
How to use it — quick steps
- 01
Enter the text or html
Type or paste the text or html in the field above. Nothing is uploaded. Use Ctrl + V to paste.
- 02
Adjust the options
Pick the settings that fit your case; the defaults work for most people. Changes apply instantly.
- 03
Press "Convert"
Press "Convert" or Ctrl + Enter. The result appears instantly below the form. Results can be copied.
Key features of this tool
Nothing leaves your browser
The processing is plain JavaScript that runs on your device: the text you paste is never uploaded to our servers or to anyone else.
Instant results
Results appear the moment you press the button, even for long inputs, and every block has copy and download actions.
Works everywhere
No installation, no account and no limits: the tool works on desktop and mobile, in any modern browser, as often as you like.
Frequently asked questions
Which characters are encoded?
The five that matter for HTML safety: & < > " and '. Optionally every non-ASCII character becomes a numeric entity for legacy systems.
Does decoding handle named entities like é?
Yes, all HTML5 named entities plus decimal and hexadecimal numeric references.
Are my files or data uploaded?
No. The tool is plain JavaScript that runs in your browser; the files or data you provide here are never uploaded to our servers.