HTML Entity Encoder/Decoder
What are HTML entities?
HTML entities are text representations of characters that would otherwise have special meaning in HTML markup, like < and &, or characters that are hard to type directly. Encoding converts these characters into a safe, literal form like < so they display correctly instead of being interpreted as HTML.
When would I use this?
- Safely displaying a code snippet containing angle brackets inside an HTML page.
- Encoding user-submitted text before inserting it into HTML, to prevent it from breaking the page structure.
- Decoding entities you see in HTML source, like &, back into readable text.
How it works
Encoding replaces reserved characters with their entity equivalents using JavaScript. Decoding uses the browser's own HTML parser to safely convert entities back to text, without executing any markup.
Frequently asked questions
Related tools
JSON Formatter
Format, validate, and beautify JSON instantly in your browser.
Base64 / URL Codec
Encode or decode Base64 and URL strings instantly.
URL Parser
Break a URL into its parts, or build a query string from key/value pairs.
YAML / JSON Converter
Convert between YAML and JSON instantly, in both directions.