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
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.
Caf\u00e9 \u2013 \u4e2d\u6587 \ud83d\udc4dCharacters
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.
Checks
Character by character
For decode modes this lists the result; otherwise the input. First 200 characters.
| Char | Code point | Decimal | UTF-8 | UTF-16 | Category |
|---|---|---|---|---|---|
C | U+0043 | 67 | 43 | 0043 | Lu · uppercase letter |
a | U+0061 | 97 | 61 | 0061 | Ll · lowercase letter |
f | U+0066 | 102 | 66 | 0066 | Ll · lowercase letter |
é | U+00E9 | 233 | C3 A9 | 00E9 | Ll · lowercase letter |
⟨space⟩ | U+0020 | 32 | 20 | 0020 | Zs · space |
– | U+2013 | 8211 | E2 80 93 | 2013 | Pd · dash |
⟨space⟩ | U+0020 | 32 | 20 | 0020 | Zs · space |
中 | U+4E2D | 20013 | E4 B8 AD | 4E2D | Lo · other letter (CJK, etc.) |
文 | U+6587 | 25991 | E6 96 87 | 6587 | Lo · other letter (CJK, etc.) |
⟨space⟩ | U+0020 | 32 | 20 | 0020 | Zs · space |
👍 | U+1F44D | 128077 | F0 9F 91 8D | D83D DC4D | So · symbol (incl. emoji) |
Share these inputs: the values go after the # in the link, so they never reach a server.
https://tapcub.com/tools/unicode-converter
Version v1.0Updated Update history
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.
Three steps
Pick what you have and what you need.
-
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
Paste the text
Results update as you type. Escapes in different formats can be mixed in one input when unescaping.
-
3
Check the table
Each character is listed with its code point, bytes and category. Invisible characters are named and highlighted, with their position.
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.dumpsescapes non-ASCII by default (ensure_ascii=True), which is why Chinese shows up as\u652f\u4ed8in many logs - MySQL’s
utf8(utf8mb3) stores at most 3 bytes per character; emoji needutf8mb4
| Character | Code point | UTF-8 | UTF-16 | JSON / JS |
|---|---|---|---|---|
| A | U+0041 | 41 | 0041 | A |
| é | U+00E9 | C3 A9 | 00E9 | \u00e9 |
| € | U+20AC | E2 82 AC | 20AC | \u20ac |
| 中 | U+4E2D | E4 B8 AD | 4E2D | \u4e2d |
| 1 (full-width) | U+FF11 | EF BC 91 | FF11 | \uff11 |
| 😀 | U+1F600 | F0 9F 98 80 | D83D DE00 | \ud83d\ude00 |
| (zero-width space) | U+200B | E2 80 8B | 200B | \u200b |
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.
| Value as typed | What the table reveals | Same as black_friday? | Fix |
|---|---|---|---|
black_friday | Plain ASCII | Yes | — |
black_friday + ZWSP | U+200B zero-width space at the end | No | Remove invisible characters |
black_friday + NBSP | U+00A0 no-break space at the end | No | Remove invisible characters, then trim the space |
blаck_friday | Third letter is U+0430, Cyrillic а | No | Retype 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.
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.
Names that stay the same everywhere
Reports group by exact values. A hidden character in a campaign or event name is enough to split one thing into several rows, so it pays to keep names clean at the source.
Validated on arrival
Unexpected event names and properties are flagged, and names that differ only in case are marked as conflicts you can merge.
Learn moreCampaign reports
Visits, conversions and revenue broken down by campaign, source and medium, read from the UTM tags on your links.
Learn moreEvent properties
Properties are stored as you send them. Keep keys in plain ASCII and the values consistent, and segments stay reliable.
Learn moreUnicode 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.
Update history
New features, fixes and data refreshes for this tool, newest first.
-
· 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
Keep event and campaign names consistent
Collect with one script, confirm event names in the inbox, and let data-quality checks catch the variants.