HTML Entity Encoder & Decoder
Escape and unescape HTML entities like &, <, >.
Convert characters to their HTML entity equivalents and back. Useful for safely embedding user content in HTML, displaying code on a webpage, or de-escaping copied source.
Common use cases
- Embed code snippets in blog posts without breaking the surrounding markup
- Sanitise user-generated content before rendering as HTML
- Decode escaped entities copied from email source or webpage view-source
- Safely include angle brackets, ampersands and quotes in static HTML
Frequently asked questions
Why escape HTML entities?▾
To prevent user-controlled text from being interpreted as HTML or executed as script. Escaping <, >, &, " and ' is the foundation of XSS-safe rendering.
Should I use named or numeric entities?▾
Named entities (&, <) are more readable; numeric (&, <) work everywhere. Both are valid HTML5 — pick named for clarity, numeric for universal compatibility.
Related tools
{}
JSON Formatter & Validator
Beautify, validate and minify JSON instantly in your browser.
↔
JSON ↔ CSV Converter
Convert JSON arrays to CSV and CSV back to JSON.
B64
Base64 Encoder & Decoder
Encode and decode Base64 strings, including UTF-8 and binary.
%
URL Encoder & Decoder
Percent-encode and decode URL components safely.