LocalExcelTool
Get started

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. 1.Enter text
  2. 2.Encode
  3. 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.

AspectThis toolUpload-based converters
Where the file is processedIn your browser, on this pageOn the vendor's servers, after an upload
Account requiredNoUsually — free tiers ask you to sign in before lifting a limit
Size you can process for freeNo size cap, no run limitA few files per hour, or a ~5–10 MB cap before a paywall
PriceFree. Pro is $9/month, and only buys larger files and AI featuresUsually a subscription — roughly $7–15/month as of November 2026
Works offlineYes, once the page has loadedNo
Time before work starts on a 20 MB fileImmediate — there is nothing to uploadDominated by the upload — about 16 s on a 10 Mbps uplink
What it cannot preserveOutput is deterministic — verify it against any other implementationThe same — the conversion is the same maths

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