The Util Box

Text to Unicode

Free online text to unicode. Convert to various Unicode formats. No sign-up, works in your browser.

Unicode
Enter text above

Embed this tool

Copy and paste the code below into your website to embed this tool for free. An attribution link to The Util Box is required.

<iframe src="https://www.theutilbox.org/embed/text-to-unicode" width="600" height="500" frameborder="0" style="border: none; max-width: 100%;" title="Free Text to Unicode tool from The Util Box"></iframe>
<!-- Free tool by The Util Box — https://www.theutilbox.org/tools/text-to-unicode -->
<a href="https://www.theutilbox.org/tools/text-to-unicode">Text to Unicode by The Util Box</a>

Frequently Asked Questions about Text to Unicode

Text to Unicode — Escape Characters as \uXXXX

This text to Unicode converter converts ordinary text into its Unicode escape form, and back again. Type a character and you get \u00e9; paste an escape and you get the character it stands for.

The escape form is what you need when a character cannot travel as itself — through a URL, a shell command, a JSON string on a system with an unexpected encoding, or a database that stores code points rather than text.

How the Conversion Works

Encoding works on UTF-16 code units. Every character above code point 127 is replaced with its four-digit hexadecimal code point, prefixed with a backslash and a u and zero-padded to four digits. ASCII characters — anything below 128 — are left exactly as they are.

Decoding runs in the other direction, finding every \uXXXX sequence and replacing it with the character it represents.

Honest Limits

  • Characters outside the Basic Multilingual Plane come out as a pair of escapes. Almost every emoji, and many historic scripts, live above the BMP, so a single 👍 becomes \ud83d\udc4d — two escapes, not one. That is correct for the JavaScript and Java escape form, but it differs from the \u{1F44D} braces form used in CSS, Rust and a few other languages.
  • Decoding only recognises the four-hex-digit form. The \u{1F44D} braces syntax, \xNN, octal escapes and the U+1F44D notation are all left alone.
  • Control characters are not escaped. A newline stays a literal newline rather than becoming \n, and a tab stays a tab. This is a Unicode escape converter, not a JSON string escaper — use the JSON Escape tool for that.
  • HTML entities are a different thing again. &amp; and &#233; are not Unicode escapes and are not converted here.

Related Text and Encoding Tools

The conversion runs entirely in your browser and works offline.