Unicode Converter

Convert text to Unicode code points.

FreeNo accountOn your device

Runs in your browser. How to verify

Loading tool…

About this tool

Paste text and get every non-ASCII character replaced by a \uXXXX escape, the form used in JSON and JavaScript strings. ASCII letters, digits and punctuation stay as they are. Emoji and other characters above U+FFFF become \u{...}.

How to use

1
Step 1
Paste text that includes non-ASCII characters.
2
Step 2
Press Run.
3
Step 3
Copy the escaped string into your code or JSON.

How it works

For each character the tool reads its Unicode code point. Characters from 0 to 127 are kept. Code points up to U+FFFF are written as \u plus four lowercase hex digits. Larger code points are written in the ES6 form \u{1f600}, which JSON does not accept: a JSON parser expects a surrogate pair instead.

Worked example

Accents, CJK and emoji

Input
Héllo 世界 😀
Output
H\u00e9llo \u4e16\u754c \u{1f600}
Walkthrough
é is U+00E9, 世 is U+4E16, 界 is U+754C and the emoji is U+1F600, which needs the braced form.

Limitations

  • This tool only encodes. It does not decode \u sequences back to text.
  • Characters above U+FFFF use \u{...}, valid in JavaScript but not in strict JSON or Java.
  • ASCII is never escaped.

Questions

How do I convert text to Unicode escapes?
Paste the text and press Run. Each non-ASCII character becomes a \uXXXX sequence.
What is the escape for é?
\u00e9.
Why does an emoji show as \u{1f600}?
It is above U+FFFF. JavaScript accepts the braced form; JSON and Java need two \u surrogate escapes.
Can it convert escapes back to text?
No. This tool converts text to Unicode escapes only, not back again.

Features

  • Four-digit lowercase hex
  • Braced form for emoji
  • ASCII untouched

Related resources

Guides and videos from around the web—opens on YouTube or the publisher’s site.

  • Learn JSON - Full Crash Course

    freeCodeCamp.org

    JSON is the payload format behind many developer tools here.

    Watch on YouTube
  • How base64 encoding works

    Andrew Schmelyun

    Mental model for Base64 encode/decode tools.

    Watch on YouTube
  • Introducing JSON

    json.org

    Canonical JSON grammar for formatters and validators.

  • Base64

    MDN

    When Base64 is appropriate versus raw binary transfer.