ZapKit

Unicode escape converter

Write accents, symbols and emoji safely in source code, JSON, HTML or CSS, or decode escapes you found in a log or API response.

What is a Unicode escape?

A Unicode escape is a way to write a character using only plain ASCII, by giving its number in a format a language understands. Developers use escapes to put non-English text in source code and config files, to make JSON safe for old systems, and to spot hidden characters.

Paste text and choose JavaScript or JSON (\uXXXX), ES6 (\u{…}), Python, HTML hex or decimal entities, CSS escapes, U+ code points or UTF-8 bytes in hex. Keep plain ASCII unchanged if you like. Switch to unescape to turn any of these formats back into readable text.

How to use the Unicode escape converter

  1. 1.Paste text

    Or escaped text to decode.

  2. 2.Pick a format

    JavaScript, Python, HTML, CSS, U+ or UTF-8 bytes.

  3. 3.Copy

    Plain ASCII can be left as it is.

Example: text with accents and emoji

"Café ✓ 日本 🚀" in three formats:

JavaScript
Caf\u00E9 \u2713 \u65E5\u672C \uD83D\uDE80
HTML
Café ✓ 日本 🚀
UTF-8 of 🚀
F0 9F 9A 80

The same five special characters, written safely for each destination.

Emoji and surrogate pairs

Characters beyond the first 65,536, which includes most emoji, don't fit in one \uXXXX escape. JavaScript and JSON write them as a surrogate pair, so 🚀 becomes \uD83D\uDE80, while ES6 \u{1F680}, Python \U0001f680, HTML 🚀 and CSS \1F680 use the code point directly.

Unescaping understands every one of those forms, even mixed in the same text, and joins surrogate pairs back into a single character. The UTF-8 option shows the actual bytes stored on disk or sent over the network.

Frequently asked questions

When do I need escapes?

When a file or system only accepts ASCII, or to make invisible and look-alike characters obvious in code.

Why does CSS add a space after the escape?

It ends the escape, so the next letter isn't read as part of the hex number.

What's the difference between a code point and UTF-8?

The code point is the character's number; UTF-8 is how it's stored, in 1 to 4 bytes.

Is my text uploaded?

No. It stays on this page.

More Developer tools