HTML Entity Encoder / Decoder
Encode characters to HTML entities and decode entities back to plain text. Safely escape HTML for display in web pages.
What Are HTML Entities?
HTML entities are special sequences that represent characters which have special meaning in HTML markup, or characters that cannot easily be typed. The five most important are:& (&), < (<), >(>), " ("), and ' ('). Encoding these characters prevents the browser from misinterpreting content as HTML markup, and is essential for preventing cross-site scripting (XSS) attacks.
Entity Formats
- Named entities:
&,©,€â€” human-readable - Decimal numeric:
©for © — universal - Hex numeric:
©for © — compact
This tool encodes the five unsafe characters as named entities and all other non-ASCII characters as uppercase hex numeric entities. The decoder handles all three formats.
Use Cases
HTML entity encoding is used when embedding user-generated content in HTML pages, displaying code examples in documentation, outputting special symbols (©, ®, €, £) in HTML without charset issues, writing HTML email templates, and escaping strings for use in HTML attributes. Always encode untrusted input before inserting it into an HTML document to prevent XSS vulnerabilities.
Related Tools
- JSON Formatter & ValidatorValidate, format and minify JSON — with syntax error highlighting.Open tool
- JWT DecoderDecode and inspect JWT token headers, payloads and signatures.Open tool
- Regex TesterTest regular expressions live with match and group highlighting.Open tool
- HTTP Status CodesReference list of all HTTP status codes with explanations.Open tool