Convert Unicode to HTML
Convert Unicode to HTML entities (hex/decimal/named/smart) with ASCII-safe option. Reverse direction parses all formats. Free, offline, client-side, secure.
Convert Unicode characters to HTML entities in 4 modes: hex (A), decimal (A), named (© when available), or smart (named when possible, numeric otherwise). ASCII-safe option preserves plain ASCII so output stays readable. Reverse direction parses all formats.
Per-character breakdown
How to Use Convert Unicode to HTML
- Paste your text. Anything Unicode. Codepoint iteration handles emoji and supplementary characters correctly.
- Pick a mode. Smart (default): named when available, hex otherwise. Hex/Decimal: always numeric. Named: prefer named, hex fallback.
- Toggle ASCII-safe. On (default): printable ASCII stays unchanged. Off: every char becomes an entity. HTML-unsafe chars (
< > & " ') always converted regardless. - Read the per-character grid. Char, codepoint, output entity, type. Color-coded for quick scanning.
- Swap to decode. Handles all three formats - named, hex, decimal - plus plain text passthrough.
- Batch mode. Multi-line input → TSV.
Frequently Asked Questions
How many named entities does the tool know?
About 250 of the most common HTML5 named entities – HTML-unsafe (<, >, etc.), Latin-1 supplement, common punctuation (em dash, ellipsis, smart quotes), Greek letters, math symbols, arrows. Characters without a named entity fall back to hex.
What does ASCII-safe preserve?
Printable ASCII (codepoints 32-126) stays unchanged. Control characters (0-31) and DEL (127) still get converted. The 5 HTML-unsafe characters are always converted regardless.
What’s Smart mode?
Named entity if one exists (© is clearer than ©), else numeric hex. Best for human-readable output.
Why are some characters always converted?
The 5 HTML-unsafe chars (< > & " ') have syntactic meaning in HTML. Leaving them un-escaped is the classic XSS vector.
How does decode handle unknown named entities?
Passes them through unchanged. Safer than throwing – your output preserves the original text intent.
What if my text has entity-like patterns?
The decode regex matches &#xNN; / &#NN; / &name; specifically. R&D (no semicolon) stays as-is.
Can I use this for SVG or XML?
Yes. Same syntax. For XML compatibility use hex/decimal (only 5 named entities are XML-standard).
How does it handle emoji?
Properly via codepoint iteration. 😀 (U+1F600) → 😀.
Is my text uploaded?
No. The conversion runs entirely in your browser – nothing is sent to a server, logged, or stored, and the tool keeps working offline once the page has loaded.
Works offline?
Yes. The whole tool weighs about 22 KB, so once the page has loaded it runs without any network connection – every conversion happens locally in JavaScript on your device.