Unicode Encode
Convert characters to \uXXXX escape sequences.
What is Unicode Encode
Unicode encoding converts characters into \uXXXX escape sequences used in string literals.
🔒 Everything runs in your browser. Nothing is uploaded.
What this tool actually does with your file
- Where it runs
- In your browser, on this page
- Upload
- None — the file never leaves your device
- Offline
- Works with the network disconnected
\uXXXX is UTF-16, not Unicode code points
The escape form \uXXXX holds exactly four hex digits, so it can only address the Basic Multilingual Plane (U+0000–U+FFFF). Characters above that — emoji, some CJK extensions, musical symbols — have to be written as a surrogate pair, two escapes that together mean one character. U+1F600 becomes 😀, and that is precisely what JSON.stringify does.
This is why a string of five emoji can produce twenty escapes: each emoji is two UTF-16 code units, and each unit is one escape. Counting escapes to estimate character length therefore overcounts by exactly the number of non-BMP characters.
Why other platforms disagree
Python, Java and C# have their own conventions: Python writes \U0001F600 with eight digits for non-BMP characters, Java uses the same surrogate-pair form as JavaScript, and PHP's json_encode by default escapes every non-ASCII character. Escapes produced in one language frequently do not round-trip in another, and the failure is silent — you get a string, just the wrong one.
If the output is going into a JSON document, do not hand-roll the escaping at all: let the serialiser do it. Hand-written \u escapes are the main source of double-escaped strings, where \\u4e2d arrives at the far end as the literal text \u4e2d.
What this encoding is good for
Turning unreadable or invisible characters into something you can inspect: zero-width spaces, line separators, non-breaking spaces, right-to-left overrides. When text looks identical but two systems disagree about whether it matches, escaping both sides and diffing the escapes finds the difference in seconds.
It is also the practical way to embed non-Latin text into environments that cannot carry UTF-8 — old config formats, some SMS gateways, and a surprising number of legacy APIs. For anything that can carry UTF-8 directly, the escapes only make the payload larger and harder to read.
How to use
- 1.Enter text
- 2.Encode
- 3.Paste into code
How this compares
There are three ways to do this conversion: in the browser (this page), through a server-side converter, or with a desktop app. The useful difference is not speed — it is where your file goes and how far the free tier actually reaches.
| Aspect | This tool | Upload-based converters | Desktop software |
|---|---|---|---|
| Where the file is processed | In your browser, on this page | On the vendor's servers, after an upload | On your own machine, after installing an app |
| Account required | No | Usually — free tiers ask you to sign in before lifting a limit | No, though a licence may be needed |
| Size you can process for free | No size cap, no run limit | A few files per hour, or a ~5–10 MB cap before a paywall | Whatever your disk and RAM allow |
| Price | Free. Pro is $9/month, and only buys larger files and AI features | Usually a subscription — roughly $7–15/month as of November 2026 | A one-off licence, or a subscription |
| Works offline | Yes, once the page has loaded | No | Yes |
| Time before work starts on a 20 MB file | Immediate — there is nothing to upload | Dominated by the upload — about 16 s on a 10 Mbps uplink | Just the app launch |
| What it cannot preserve | Output is deterministic — verify it against any other implementation | The same — the conversion is the same maths | The same, though some desktop apps re-render styles more faithfully |
Server-side converters are genuinely better at some things: very large files, sharing results with a team, keeping a conversion history, and automating batches from a script. For the case in front of you — one file, one format change, right now — they mostly add an upload wait and a sign-up form.
Frequently asked questions
What is a Unicode escape?
A 6-character form like \u0041 representing one character.
Surrogate pairs?
Yes, emoji and other surrogate pairs are handled correctly.
What this kind of conversion cannot keep
Encoding and hashing run through the browser's Web Crypto API or a pure-JavaScript implementation. The output is deterministic: the same input always produces the same digest, so you can verify a result against any other tool.
More in Encoding
On this page
- What is Unicode Encode
- What it does with your file
- How it actually behaves
- How to use it
- How this compares
- FAQ
Excel formula reference
29 functions with syntax, arguments and a table you can retype.
Browse the list →