Unicode Encoder

Convert plain text with clear format options. Your data stays on your device.

Encoding & Decoding
Preparing your workspace…
Input
Output
Your result will appear here.

How to use

  1. Paste text, open a file, or try the sample.
  2. Choose the format. The result updates as you type.
  3. Copy the result or download the converted data.

Understanding Unicode encoding

Represent Unicode text with explicit escape sequences. By default, non-ASCII characters use UTF-16 \uXXXX escapes and ordinary ASCII stays readable.

Choose code point escapes for JavaScript or escape ASCII too. Supplementary characters use surrogate pairs in UTF-16 mode and one \u{…} escape in code point mode.

UTF-16 escapes

A \uXXXX escape represents one UTF-16 code unit. Characters outside the basic multilingual plane require two escapes, preserving the character as a surrogate pair.

A Unicode conversion
Input
Hello, world! 👋
Result
Hello, world! \ud83d\udc4b

The default settings convert this input in one pass.

JavaScript code point notation

Code point mode writes \u{…} for non-ASCII code points. It is valid JavaScript string syntax but is not a JSON escape format. Backslashes, quotes and control characters are escaped in both modes.

String contents, not a document

The output has no surrounding quotation marks. It does not add JSON properties or evaluate code. Unpaired surrogate input is rejected so UTF-8 copy and file export cannot silently change it.

Processing limits

Up to 5 MiB of input, 20 MiB of output, and 10 seconds per run. Text files must use UTF-8. Base64 encoding also accepts binary files. Documents stay on your device.

?

Frequently asked questions

Can I paste the output into JSON?

Use UTF-16 mode and add surrounding double quotes where a JSON string is expected. Code point braces are not valid JSON escapes.

Why does an emoji produce two escapes?

UTF-16 represents a supplementary character as two code units. Code point mode uses one escape instead.

Can I escape ASCII characters too?

Yes. Enable Escape ASCII too; quotes, backslashes and controls are always escaped.

Does encoding normalize my text?

No. Composed and decomposed forms remain distinct; there is no Unicode normalization.

Does the tool add quotes?

No. It returns escaped string contents only.

Find your next tool

Language

Switch language? Your current work will be cleared. Copy or download it first.