HTML Entity Encode / Decode
Escape special characters as HTML entities or decode entities back to text.
About the HTML Entity Encode / Decode
Characters such as <, > and & have special meaning in HTML. Encoding them as entities lets you display code and user text safely; decoding turns entities back into readable characters.
Everything runs in your browser, so your input is never uploaded to a server.
How to use the HTML Entity Encode / Decode
- Choose Encode or Decode.
- Paste the text or HTML.
- Optionally encode all non-ASCII characters, then copy the result.
Frequently asked questions
Does encoding protect against XSS?
Encoding text before inserting it into HTML is a key part of preventing XSS, but the right escaping depends on where the text goes (HTML, attributes, URLs or scripts).
Why encode non-ASCII characters?
Only when the page or system cannot handle UTF-8. Modern pages served as UTF-8 do not need it.
Related tools
Base64 Encode / Decode
Encode text to Base64 or decode Base64 to text with full UTF-8 and URL-safe support.
URL Encode / Decode
Percent-encode or decode URLs and query string components.
JWT Decoder & Verifier
Decode JSON Web Tokens, inspect header and claims, check expiry and verify HMAC signatures locally.
JWT Generator
Create signed JSON Web Tokens with HS256, HS384 or HS512 from a custom header and payload.
Unicode Escape / Unescape
Convert text to \uXXXX escape sequences and back, including emoji and astral characters.
JSON Formatter
Format and beautify JSON with configurable indentation and optional key sorting. Errors are reported with exact line and column.