HTML Entity Encode/Decode
EncodingEncode special characters to HTML entities or decode HTML entities back to characters
All processing happens locally in your browser — your data never leaves your machine.
Loading tool...
Examples
Encode HTML Tags
Input
<div class="alert">Price: $5 & up</div>Output
<div class="alert">Price: $5 & up</div>Encode Non-ASCII Characters
Input
© 2026 — Café résuméOutput
© 2026 — Café résuméDecode HTML Entities
Input
<p>Tom & Jerry — © 2026</p>Output
<p>Tom & Jerry — © 2026</p>Frequently Asked Questions
- What are HTML entities?
- HTML entities are special sequences that represent characters which have a reserved meaning in HTML, such as <, >, &, and ". For example, < represents the less-than sign (<). They prevent browsers from interpreting those characters as HTML markup.
- What is the difference between named and numeric HTML entities?
- Named entities use a human-readable name (e.g. & for &, < for <), while numeric entities use the character's Unicode code point in decimal (&) or hexadecimal (&) form. Both are valid HTML and produce the same result in a browser.
- When should I use HTML entity encoding?
- You should encode text when inserting user-generated content into HTML to prevent XSS attacks and rendering issues. Any character that could be interpreted as HTML markup — particularly <, >, &, ", and ' — must be encoded to display correctly and safely.