HTML Entity Encoder / Decoder
Escape text so it can be shown inside an HTML page, or turn entities like &, and ’ back into the characters they stand for.
Output
🔒 Runs in your browser. Your data is never uploaded.
How to use
- Choose Encode or Decode.
- Paste your text or HTML.
- Copy the result.
Only five characters need escaping
In a UTF-8 page, the characters that must be escaped are & < > and, inside attribute values, the quote marks. Accented letters, CJK text and emoji can be written directly. The non-ASCII option is for systems that only pass ASCII safely, such as some email templates.
Frequently asked questions
- Why is the apostrophe encoded as ' and not '?
- ' is defined in XML and HTML5 but not in HTML 4, so some old clients show it literally. The numeric form ' works everywhere.
- Does escaping prevent XSS?
- It is the correct defence when inserting untrusted text into HTML content or a quoted attribute. It is not enough inside a script block, a URL or CSS, which have their own escaping rules.
- Which entities can be decoded?
- All numeric entities, decimal and hexadecimal, plus the common named ones such as , ©, — and accented letters. An unrecognised name is left as it is.
Related tools
- URL Encode / DecodePercent-encode text for URLs or decode an encoded URL back to readable text.
- Base64 Encode / DecodeEncode text to Base64 or decode Base64 back to text.
- Markdown to HTML ConverterConvert Markdown to clean HTML in your browser.
- JSON Formatter & ValidatorFormat, validate and minify JSON in your browser.