Unicode Converter
Convert characters to Unicode escape sequences and escape sequences back to text.
Code points made visible
Unicode gives characters abstract numbers called code points. H is U+0048, € is U+20AC, and the rocket is U+1F680. A Unicode escape writes that number as source text so a character can be represented without typing or displaying the glyph directly. This converter turns text into brace-form escapes such as \u{1F680} and decodes both brace form and four-digit \uXXXX sequences.
It is useful when preparing JavaScript examples, diagnosing invisible characters, reading escaped API data, or checking a code point. It is not a character-set detector, UTF-8 byte encoder, normalization utility, or complete parser for every programming language’s escape grammar.
Encoding text to escape sequences
Select Text to Unicode and enter:
Hi 🚀
The output is:
\u{48}\u{69}\u{20}\u{1F680}
The component iterates Unicode code points, calls codePointAt(0), writes uppercase hexadecimal, and places every value in \u{...}. Even ordinary ASCII is escaped; spaces become \u{20} rather than remaining literal. There is no minimum four-digit padding, so H is \u{48}, not \u0048.
Brace-form escapes are supported by modern JavaScript in Unicode-aware contexts, but not every language or data format accepts them. JSON string syntax, for example, requires four hexadecimal digits after \u and represents supplementary code points as surrogate-pair escapes. Convert the notation to the destination’s grammar before embedding it.
Decoding two accepted forms
In Unicode to Text mode, the converter first replaces \u{HEX} patterns of any matched hexadecimal length, then replaces exactly four-digit \uXXXX patterns. These examples decode:
\u{43}\u{61}\u{66}\u{E9}
\u0043\u0061\u0066\u00E9
Both produce Café. Ordinary text not matching either pattern remains unchanged, so Status: \u{4F}\u{4B} becomes Status: OK. Escapes are adjacent or embedded; separators are not needed.
The four-digit path uses String.fromCodePoint for each code unit. A conventional JSON-style surrogate pair such as \uD83D\uDE80 is replaced as two surrogate characters, which JavaScript then displays together as the rocket when correctly paired. Brace form expresses it directly as \u{1F680}.
Code points are not encoded bytes
U+1F680 names a character. UTF-8 serializes that code point as four bytes; UTF-16 serializes it as a surrogate pair; UTF-32 uses one 32-bit unit. This tool displays and consumes code-point escapes, not byte sequences. It will not decode F0 9F 9A 80 or %F0%9F%9A%80.
When debugging an HTTP payload, first determine its representation. JSON source might contain literal Unicode, JSON \uXXXX escapes, or UTF-8 bytes viewed in hex. Browser developer tools often show a decoded string rather than original bytes. Choose a converter that matches the layer you actually have.
Finding an invisible character
A practical workflow is to paste a suspicious string into Text to Unicode. Every space, tab, newline, combining mark, and zero-width character becomes a visible code-point token. Compare the sequence with a known-good string. A regular space appears as \u{20}, non-breaking space as \u{A0}, and zero-width space as \u{200B}.
This is valuable when identifiers look equal but fail comparison. It can expose typographic quotes, a non-ASCII hyphen, or combining accents. It does not tell you the Unicode character name or category, so look up the resulting U+ value in a Unicode database when classification matters.
After locating the difference, fix the data at its source. Blindly deleting every non-ASCII character can damage names and languages. Apply a narrowly defined normalization or validation policy appropriate to the field.
Normalization and grapheme boundaries
Unicode permits multiple code-point sequences that render similarly. Precomposed é can be U+00E9, while decomposed e plus combining acute accent is U+0065 U+0301. The converter faithfully shows whichever sequence is present and does not apply NFC, NFD, NFKC, or NFKD normalization.
A visible “character” can also contain several code points: emoji may include skin-tone modifiers, variation selectors, zero-width joiners, or regional indicators. Text-to-Unicode output exposes each component. That is correct even when the user sees one grapheme cluster. Do not use escape count as a user-visible character count.
Invalid and out-of-range escapes
Brace-form hexadecimal is converted with String.fromCodePoint. Unicode scalar values end at U+10FFFF. An out-of-range value throws, clears output, and shows the decoding error message. An empty brace, nonhex digit, or incorrectly sized plain escape does not match and remains literal rather than necessarily raising an error.
This permissive behavior is convenient for mixed prose but unsuitable for strict validation. \u123 stays as typed because plain form requires exactly four hex digits. \U0001F680, HTML 🚀, CSS escapes, percent encoding, Python \N{...}, and U+1F680 are not decoded. Backslash escaping from an outer language may also mean the actual input contains two backslashes; inspect the runtime string rather than source appearance.
Working with JSON and JavaScript
JavaScript supports \uXXXX and, in modern syntax, \u{X}. JSON only defines \uXXXX. To place a supplementary code point in raw JSON escape notation, use its surrogate pair or let a JSON serializer handle the string. Do not paste brace output directly into JSON and assume validity.
When analyzing a parsed API response, the JSON parser may already have turned escapes into characters. Encode that resulting text here to inspect code points. When creating a response, build ordinary Unicode strings and use the platform serializer; manual escaping is more error-prone and can double-escape backslashes.
Regular expressions add another layer. Whether \u{...} is recognized can depend on the language and Unicode flag. Consult the target engine rather than treating this tool’s notation as universal.
Security-sensitive text review
Visible escapes can reveal mixed-script identifiers and hidden controls, but they are not a complete defense against Unicode spoofing. Confusable characters, bidirectional controls, normalization differences, and locale-specific case mapping require dedicated libraries and a documented policy. Never assume text is safe merely because every code point is valid.
For logs, consider rendering control characters safely so they cannot reorder or hide displayed content. For identifiers, normalize at a defined boundary and compare according to the protocol. For international user text, preserve legitimate scripts rather than applying ASCII-only filtering.
Escape notation in source files
An escape often passes through more than one parser. A JavaScript string containing the literal six characters \u0041 must escape its backslash as "\\u0041"; otherwise the language parser turns it into A before application code sees it. A JSON document embedded inside a shell command adds still another quoting layer.
When conversion appears to happen too early or not at all, inspect the runtime value with a debugger and count actual backslashes. Avoid repeatedly adding slashes by trial and error. Let serializers produce JSON and command argument arrays wherever possible. This prevents double escaping, in which intended text becomes a visible backslash sequence at the destination.
Troubleshooting escape conversion
If \u{48} remains literal, verify that it contains one backslash, lowercase u, braces, and hexadecimal digits. If \u48 does not decode, plain notation requires four digits: \u0048. If JSON rejects generated output, use JSON-compatible four-digit escapes or a serializer. If an emoji becomes two plain escapes, those may be a valid UTF-16 surrogate pair.
If visually identical strings produce different sequences, investigate normalization and combining marks. If output errors on a large value, keep it at or below U+10FFFF and avoid surrogate scalar values in brace notation. Switching modes loads a sample and replaces input, so preserve work before toggling.
Unicode FAQ
Does the converter support emoji?
Yes. Text encoding uses code points, so a basic supplementary emoji becomes one brace escape such as \u{1F680}.
Can I decode JSON Unicode escapes?
It decodes individual four-digit \uXXXX forms, including paired surrogates that may render together. It does not parse a whole JSON document or process JSON quoting rules.
Why are escapes not padded to four digits?
Encoding always uses brace form, where variable-length hexadecimal is valid in supporting languages.
Does it normalize Unicode?
No. Canonically equivalent sequences remain distinct and visible.
Can it convert Unicode to UTF-8 hex?
No. Code-point notation and UTF-8 bytes are different representations. Use a UTF-8 byte encoder.
Is unmatched text removed?
No. Decode mode replaces recognized escape patterns and leaves other content in place.