JSON Escape and Unescape
Escape and unescape JSON string content safely.
Convert Unicode text to named, decimal or hexadecimal HTML character references, or decode references such as &, © and 😀 back to text.
Your text is processed in this browser and is not submitted to UnicodeNow.
Named mode uses named references where available and hexadecimal numeric references otherwise.
HTML escaping depends on where the value will be inserted.
Paste text or HTML character references. Input remains local to this browser.
This tool converts Unicode text into HTML character references and decodes HTML references back into Unicode text. Encoding can produce minimal HTML escaping, named references such as ©, decimal references such as ©, hexadecimal references such as ©, or a structured comparison of all representations. Decoding accepts valid named, decimal and hexadecimal references and returns text, not executable markup. Processing is local in your browser.
The controls are designed for text values that will be inserted into HTML, not for validating complete documents. If you need to place a value into JavaScript, CSS or a URL, use the matching encoder for that context. HTML escaping protects syntax boundaries; it does not decide whether markup is trustworthy.
| Character | Named | Decimal | Hexadecimal |
|---|---|---|---|
& | & | & | & |
< | < | < | < |
> | > | > | > |
" | " | " | " |
' | ' | ' | ' |
é | é | é | é |
© | © | © | © |
😀 | No common named entity | 😀 | 😀 |
Named references are readable for common characters, but not every Unicode character has a named HTML reference. Decimal and hexadecimal references identify a Unicode code point numerically. Hexadecimal often aligns naturally with Unicode U+ notation: U+00E9 becomes é. Numeric HTML references are not UTF-8 bytes.
In HTML text, ampersands can begin character references and less-than signs can begin markup. This tool also escapes greater-than signs in minimal mode for clarity. In attributes, the matching quote character must be escaped too: " for double-quoted attributes and ' for single-quoted attributes. Ordinary accented letters, CJK text, Cyrillic text, Arabic text and emoji usually do not need entities in UTF-8 HTML.
é
U+00E9
HTML: é
UTF-8: C3 A9
The HTML parser resolves é into the Unicode character é. UTF-8 later encodes that character as bytes C3 A9. Writing é is not the correct reference for é; it references two separate code points.
Double encoding happens when already-escaped text is escaped again: & becomes &, then &amp;. Store Unicode text where possible and escape at the output boundary for the actual HTML context. If the decoder returns literal text such as é, one layer has been decoded and another may remain by contract or by mistake.
This tool runs in your browser. Your input is not submitted to UnicodeNow. The page uses local JavaScript for conversion, statistics and warnings, and the output textarea contains selectable text only.
An HTML entity, more precisely an HTML character reference, is source syntax that represents a character in HTML.
They are named, decimal and hexadecimal references for U+00E9, LATIN SMALL LETTER E WITH ACUTE.
No. Literal UTF-8 text is normally preferable for ordinary content.
Escaping is context-dependent, but ampersands and less-than signs require attention in text; quotes matter in matching attribute contexts.
No. It represents U+00A0 NO-BREAK SPACE, which affects line breaking.
The ampersand was escaped, so after one HTML parsing layer the result is literal entity text.
No. HTML entities are markup syntax for characters. UTF-8 is a byte encoding.
Yes. It decodes valid named, decimal and hexadecimal HTML character references.
No. Decoding returns text. It must still be escaped or sanitized for its destination.
No. This tool runs in your browser and does not submit input to UnicodeNow.
Escape and unescape JSON string content safely.
Escape JavaScript string literals and decode JS escape notation without eval.
Escape and unescape PHP-style single and double quoted strings.
Convert Python string escapes without executing Python code.
Convert text to and from Unicode escape sequences and numeric entities.
Escape and decode XML entities and numeric character references.
Convert text to UTF-8 bytes and validate byte sequences.
Inspect each Unicode character, encoding, category, script and normalization form.
Convert text into U+XXXX Unicode code point notation.
Encode and decode URL components, full URLs and form-style strings.
Find zero-width, control, variation, private-use and spacing characters.
Unicode defines characters and code points. UTF-8 encodes those code points as bytes for files, databases, web pages, APIs and network messages.
Learn NFC, NFD, NFKC and NFKD, canonical and compatibility equivalence, and safe normalization for comparison, search and identifiers.
Learn how zero-width spaces, joiners, non-breaking spaces, bidi controls and other invisible Unicode characters affect text.
Learn how Unicode escape syntax works across JavaScript, JSON, Python, PHP, Java, HTML, CSS and URLs.
Compare literal Unicode characters, named HTML entities, numeric character references, code points and UTF-8 bytes.