HTML Entity Encoder & Decoder
Encode reserved HTML characters as entities or decode HTML entities back to readable text for snippets, CMS content, and templates.
What is this tool?
This HTML entity converter encodes reserved markup characters such as <, >, and & into HTML-safe entity text, then decodes entity text back to readable characters. Entities are how HTML represents characters that would otherwise be parsed as markup or ambiguous syntax.
Entity conversion is context-sensitive in real applications. Text nodes, attribute values, JavaScript strings, CSS, SVG, and XML do not all share identical escaping rules. This tool is useful for inspection and preparation, but production rendering should still rely on framework escaping and trusted sanitizers.
Use it to diagnose double-encoded CMS content, prepare visible code snippets, or confirm how reserved characters will appear when embedded in HTML.
How to use
- Use Encode when text should display literally inside HTML instead of being interpreted as markup.
- Use Decode when you need to read text that already contains entities.
- Paste the text, run the conversion, and copy the result.
- For untrusted HTML, still use your framework's escaping and sanitization model. Entity conversion is not a complete XSS defense.
Examples
| Input / setting | Output | Notes |
|---|---|---|
Tom & Jerry | Tom & Jerry | The ampersand is encoded for HTML text. |
<strong>Hi</strong> | <strong>Hi</strong> | Markup characters become visible text. |
<div> | <div> | An encoded tag decoded back to readable characters. |
Related tools & concepts
Last reviewed: 2026-05-08