TapCub is live — analytics, insights and live chat, free on one platform

Free tool Unicode converter: escapes, UTF-8 bytes and code points

Turn text into \u4e2d-style escapes for JSON or source code, read escaped logs back as text, and see exactly which code points and bytes a string is made of. It also finds the zero-width and no-break spaces that make two identical-looking values different.

  • Seven escape formats
  • Spots invisible characters
  • Runs locally
Converter

Convert and inspect Unicode text

The sample mixes an accented letter, a dash, Chinese and an emoji, the four cases that trip up escaping. The table under the result shows every character.

Escapes in any of the supported formats can be mixed in one input.

Result
Caf\u00e9 \u2013 \u4e2d\u6587 \ud83d\udc4d

Characters

11

Unicode code points; an emoji counts as one.

UTF-16 units

12

What JavaScript’s .length reports.

UTF-8 bytes

21

Size when stored or sent as UTF-8.

Invisible

0

Zero-width, no-break and other hidden characters.

Character by character

For decode modes this lists the result; otherwise the input. First 200 characters.

CharCode pointDecimalUTF-8UTF-16Category
CU+004367430043Lu · uppercase letter
aU+006197610061Ll · lowercase letter
fU+0066102660066Ll · lowercase letter
éU+00E9233C3 A900E9Ll · lowercase letter
⟨space⟩U+002032200020Zs · space
–U+20138211E2 80 932013Pd · dash
⟨space⟩U+002032200020Zs · space
中U+4E2D20013E4 B8 AD4E2DLo · other letter (CJK, etc.)
文U+658725991E6 96 876587Lo · other letter (CJK, etc.)
⟨space⟩U+002032200020Zs · space
👍U+1F44D128077F0 9F 91 8DD83D DC4DSo · symbol (incl. emoji)
Runs entirely in your browser. Nothing you type here is uploaded or stored by TapCub.

Share these inputs: the values go after the # in the link, so they never reach a server.

Version v1.0Updated Update history

Read the result

Code points, UTF-16 and UTF-8

Every character has one number in Unicode, its code point. Escapes and encodings are different ways of writing that number down.

Code point

The identity of a character, written U+4E2D for 中. There are 1,114,112 possible code points, from U+0000 to U+10FFFF. The table gives each character’s code point and general category.

\u escapes and UTF-16

JavaScript, JSON and Java strings are UTF-16. Characters above U+FFFF, including most emoji, take two 16-bit units, a surrogate pair, so 👍 becomes \ud83d\udc4d and counts 2 in .length.

UTF-8 bytes

The web’s standard encoding: 1 byte for ASCII, 2 for most Latin accents, 3 for Chinese, 4 for emoji. Those bytes are what URLs percent-encode and what databases store.

Invisible characters

Zero-width spaces, BOMs, direction marks and no-break spaces render as nothing or as a normal space. They are the usual reason two values that look the same do not match.

Two strings that look identical can still differ in code points. When a filter, a join or a lookup fails for no visible reason, paste both values here and compare the character tables.

How to use it

Three steps

Pick what you have and what you need.

  1. 1

    Choose the mode

    Escape text for code, unescape a log or JSON dump, get UTF-8 bytes, fix full-width characters or strip invisible ones.

  2. 2

    Paste the text

    Results update as you type. Escapes in different formats can be mixed in one input when unescaping.

  3. 3

    Check the table

    Each character is listed with its code point, bytes and category. Invisible characters are named and highlighted, with their position.

Reference

One character, five ways to write it

Values checked with Python’s str.encode and json.dumps. JSON’s \u escape is the UTF-16 form, which is why an emoji needs two.

  • UTF-8 uses 1–4 bytes per code point and never encodes surrogates (RFC 3629)
  • Full-width ASCII forms U+FF01–U+FF5E sit exactly 0xFEE0 above their half-width twins; the ideographic space is U+3000
  • Python’s json.dumps escapes non-ASCII by default (ensure_ascii=True), which is why Chinese shows up as \u652f\u4ed8 in many logs
  • MySQL’s utf8 (utf8mb3) stores at most 3 bytes per character; emoji need utf8mb4
Code point, UTF-8, UTF-16 and JSON escape for sample characters
CharacterCode pointUTF-8UTF-16JSON / JS
AU+0041410041A
éU+00E9C3 A900E9\u00e9
€U+20ACE2 82 AC20AC\u20ac
中U+4E2DE4 B8 AD4E2D\u4e2d
1 (full-width)U+FF11EF BC 91FF11\uff11
😀U+1F600F0 9F 98 80D83D DE00\ud83d\ude00
(zero-width space)U+200BE2 80 8B200B\u200b
Worked example

Why one campaign shows up as four rows

A campaign tagged black_friday in four places, copied from a doc, a chat message and a spreadsheet. They look the same; the code points say otherwise.

Look-alike campaign values and what is really in them
Value as typedWhat the table revealsSame as black_friday?Fix
black_fridayPlain ASCIIYes—
black_friday + ZWSPU+200B zero-width space at the endNoRemove invisible characters
black_friday + NBSPU+00A0 no-break space at the endNoRemove invisible characters, then trim the space
blаck_fridayThird letter is U+0430, Cyrillic аNoRetype the value

Analytics tools compare values exactly, so each variant becomes its own row in campaign reports. Lowercase ASCII names with underscores, typed rather than pasted, avoid all four problems.

Common mistakes

Where Unicode handling goes wrong

The characters are rarely wrong. The assumptions about them are.

Counting with .length

JavaScript counts UTF-16 units, so 👍 is 2 and a flag emoji is 4. Use code points for character limits, and UTF-8 bytes for storage limits.

Storing emoji in MySQL utf8

utf8 (utf8mb3) holds at most 3 bytes per character, so 4-byte emoji fail or get cut. Use utf8mb4 for user text.

Pasting values from documents

Word processors and chat apps insert no-break and zero-width spaces. A tag or event name pasted from them differs from the one typed in code.

Unescaping twice

Decoding \\u4e2d once gives the text \u4e2d, not 中. Check whether backslashes were themselves escaped before decoding again.

FAQ

Unicode questions

Still have a question?

Chat with the team behind TapCub — we usually reply within a few hours on business days.

How do I convert text to Unicode escapes?

Choose "Text → Unicode escapes" and pick the format your language uses: \uXXXX for JavaScript, JSON and Java; \u{…} for modern JavaScript; \U0001F600 style for Python and C; U+XXXX for documentation. By default only non-ASCII characters are escaped.

How do I decode \u escapes back to text?

Choose "Unicode escapes → text" and paste. \u4e2d, \u{1F600}, %u4E2D from old JavaScript escape(), U+4E2D, HTML numeric references and \xE4\xB8\xAD byte escapes are all recognised, even mixed in one text.

Why does an emoji turn into two \u escapes?

JSON and JavaScript strings are UTF-16. Characters above U+FFFF are stored as two 16-bit surrogates, so 😀 (U+1F600) is written \ud83d\ude00. Use the \u{1F600} or Python format if you want one escape per character.

What is the difference between Unicode and UTF-8?

Unicode assigns every character a number, its code point. UTF-8 is one way to store those numbers as bytes, using 1 to 4 bytes each. UTF-16 is another, used inside JavaScript, Java and Windows.

How do I find and remove zero-width characters?

Paste the text: the checks list every invisible character with its name, code point and position, and the "Invisible" count shows the total. "Remove invisible characters" deletes zero-width and direction marks and turns no-break spaces into normal ones, while keeping the joiners inside emoji like 👨‍👩‍👧.

What are full-width characters?

Versions of ASCII letters, digits and punctuation that take the width of a Chinese character, such as A or 1, at U+FF01–U+FF5E. They come from East Asian input methods and are different characters from A and 1, so search and matching treat them differently.

Is what I paste sent anywhere?

No. Everything runs in your browser. The share link puts the text after # in the address, which browsers do not send to servers, but anyone with the link can read it.

Changelog

Update history

New features, fixes and data refreshes for this tool, newest first.

  1. · v1.0

    LaunchedFirst release.

Missing something or found an error? Tell us — requests that come up often go into the next update. All tool updates

Next step

Keep event and campaign names consistent

Collect with one script, confirm event names in the inbox, and let data-quality checks catch the variants.

See your data clearly. Find your growth.

Every click, backed by data. Install one line of code and see your first numbers in a minute.

No credit card · Free plans for analytics and chat · Cookieless analytics