Unicode Converter
Convert text to Unicode escapes, code point escapes, HTML entities, UTF-8 bytes, URL encoding and Base64, with reverse parsing and a code point table.
How to use
- Type or paste text in the input area and all seven formats appear at once, each with its own copy button.
- Use the backslash-u form for CSS content values or JS strings. Characters outside the BMP are split into correct surrogate pairs.
- Use entities for HTML documents. Decimal and hex forms are equivalent, with hex being the more common convention.
- When debugging encoding, read the UTF-8 byte line and cross check it against the statistics row.
- To restore text, paste any escape sequence into the reverse box, press the button, and the detected format is named above the result.
FAQ
What is a code point, and what is a surrogate pair?
Where can backslash-u escapes be used?
Why do Base64 and UTF-8 hex have different lengths?
Does the conversion run locally?
How to use
- Enter your text
Paste or type into the input area and all seven formats appear at once, each with its own copy button, refreshing as you type.
- Pick the right form
Use backslash-u escapes for JS strings or CSS content, entities for HTML, and the UTF-8 byte line when debugging encoding.
- Inspect the table
The detail table lists every character with its code point, decimal value and UTF-8 byte count, up to 200 rows, for character by character checks.
- Restore text
Paste any escape sequence into the reverse box and press the button. The tool detects the format and prints it above the restored text.
About this tool
This converter targets developers and writers who move between escape formats all day. One input produces the backslash-u escape, the code point escape, HTML entities in decimal and hex, the UTF-8 byte sequence, URL encoding and Base64, all equivalent views of the same text and all refreshed live. Every format carries its own copy button so the value lands on your clipboard without extra characters. The layout stays clean on phones as well.
Supplementary plane characters are handled correctly. Emoji and other characters numbered above FFFF must appear as a surrogate pair in UTF-16, and naive converters split or drop them. This tool splits by code point first, so the escapes are always valid. Reverse parsing understands all seven formats, resolves mixed sequences by their markers, and names what it detected. Everything runs locally in the browser, and nothing you paste ever leaves the device.
How it works
Unicode assigns every character a number called a code point, conventionally written with U+ followed by hex digits. UTF-16 maps common characters to single sixteen bit code units, while characters above FFFF are spelled with a high and low surrogate, each four hex digits. The backslash-u escape is the direct spelling of a code unit, so emoji appear as paired escapes, while the code point escape writes the original number in braces. Both forms are equivalent in JS.
UTF-8 is a byte level scheme: smaller numbers use fewer bytes, from one up to four, with common Chinese characters taking a stable three. HTML entities wrap the code point between an ampersand and a semicolon, and the browser renders the character back. Base64 turns any byte stream into sixty four safe characters. All these views round trip without loss, which is exactly how the reverse parser peels formats away layer by layer.
When to use it
- Repairing mojibake in source
When inherited code shows strings of question marks or boxes, convert the correct text to backslash-u escapes and put those in the source. The file stays ASCII, so it survives any encoding a teammate opens it with and never corrupts again.
- Debugging API encoding
When a server returns percent strings or garbage instead of Chinese, paste the payload into the reverse box and read the detected format. Whether it is URL encoding, entities or Base64, the answer points straight at the broken stage of the pipeline.
- Auditing multilingual copy
Convert brand names and emoji rich copy, then walk the code point table character by character to catch lookalike or invisible characters before delivery, closing a subtle spoofing risk before release. A short audit at release time prevents costly fixes later.
Tips & tricks
- For CSS content values prefer backslash-u escapes, and remember characters outside the BMP need two four digit escapes in a row.
- When chasing mojibake, read the UTF-8 byte line first, since sequences like E4 B8 AD map directly onto encoding tables.
- If a URL encoded string contains plus signs it likely came from legacy form encoding, while this tool emits standard percent encoding.
- The table caps at 200 rows, so inspect long texts in chunks while the statistics row always counts the full input.
Things to watch
- Counting bytes as characters
JS length counts UTF-16 code units, so an emoji counts as two, and database byte truncation can split characters in half. Count and slice by code point, which is why the statistics row shows three separate figures. Splitting mid character corrupts data silently.
- Writing half a surrogate pair
Copying only the high half of a pair produces an invalid string that renders as a question mark in most environments. Escapes for supplementary characters must come in pairs, and generating them with the tool guarantees that. Always paste both halves together.
- Confusing encoding with encryption
Base64 and percent encoding only change representation, and anyone can reverse them with the same standard tools you used to create them. They solve transport compatibility, not secrecy. When confidentiality actually matters, use real encryption with a proper key, and treat encoding as a plain formatting step in the pipeline.