About this tool
Transform HTML character references without rendering decoded markup, while keeping document context, Unicode policy, parse recovery, and injection limits explicit.
HTML Entity Encoder and Decoder is useful when text needs to move safely between readable characters and escaped HTML entities. It helps with templating, CMS content, snippets, and debugging cases where symbols render incorrectly or need safe encoding.
- Uses he 1.2.0 for HTML5 named and numeric references, astral Unicode code points, and strict parse errors.
- Separates text-node, double-quoted attribute, single-quoted attribute, and conservative six-character encoding contexts with named, decimal, or hexadecimal output.
- Supports optional ASCII-only encoding and one to five explicit decode passes with stale-result protection and TXT export.
How to use HTML Entities
Paste the input, choose whether you need encoding or decoding, and review the transformed text before copying it into the target HTML or content workflow. When special symbols matter, test the real final string so you can confirm the result matches the rendering context you care about.
When this tool is useful
- Uses he 1.2.0 for HTML5 named and numeric references, astral Unicode code points, and strict parse errors.
- Separates text-node, double-quoted attribute, single-quoted attribute, and conservative six-character encoding contexts with named, decimal, or hexadecimal output.
- Supports optional ASCII-only encoding and one to five explicit decode passes with stale-result protection and TXT export.
Examples you can test
Load an example, compare the result with the expected output, then replace it with your own input.
Encode unsafe HTML characters
Example input
<span>Tom & Jerry</span>
Expected output
<span>Tom & Jerry</span>
Encoding is useful when showing markup as text instead of letting the browser parse it.
Decode copied entity text
Example input
Utiloom & tools
Expected output
Utiloom & tools
Decoding helps review text copied from HTML source, CMS fields, or feeds.
Validation checklist
- Encode text before displaying literal markup inside HTML.
- Do not decode untrusted input and insert it as HTML without sanitization.
- Check quotes and ampersands when output will be used inside attributes.