What you're seeing
Every character you type is stored as one or more bytes, and this tool shows those bytes in hexadecimal as you type. Plain English letters map one to one: "Hi" is 48 69. Anything beyond basic ASCII takes more bytes, and the count under the output shows how many.
Try the default text, Café ☕:
| Character | Code point | UTF-8 bytes |
|---|---|---|
| C | U+0043 | 43 |
| a | U+0061 | 61 |
| f | U+0066 | 66 |
| é | U+00E9 | C3 A9 |
| (space) | U+0020 | 20 |
| ☕ | U+2615 | E2 98 95 |
That's six characters but nine bytes. The per-character panel lists every character with its code point, so you can see which ones are multi-byte.
Encodings
UTF-8 is what you want nine times out of ten. It's the encoding of the web, of JSON, of most source files and of Linux and macOS filenames.
UTF-16 stores most characters in two bytes. Choose:
- BE (big-endian), where the high byte comes first: é becomes
00 E9; - LE (little-endian), where the low byte comes first: é becomes
E9 00.
Windows APIs, .NET and Java strings, and JavaScript's internal strings use UTF-16, usually little-endian on disk. In UTF-16 the Café ☕ example is 12 bytes. Characters outside the Basic Multilingual Plane, such as most emoji, become a surrogate pair of four bytes. 😀 is D8 3D DE 00 in UTF-16 BE.
Output styles
| Style | Looks like | Use it for |
|---|---|---|
| Spaced | 43 61 66 | reading, docs, comparing with hex editors |
| Plain | 436166 | hashes, database literals (X'436166' in SQL) |
| 0x list | 0x43, 0x61, 0x66 | array initializers in C, C++, Rust, Python |
| Escaped | \x43\x61\x66 | string literals in C, Python, JavaScript, shell printf |
| C array | const unsigned char data[3] = {…}; | embedding data in firmware or C code |
| URL | %43%61%66 | percent-encoding a query parameter |
Tick lowercase if your codebase or tool expects c3 a9 rather than C3 A9. Both mean the same thing.
Typical uses
- Debugging encoding bugs. If a database shows "é" where you expected "é", compare the stored bytes with what UTF-8 should produce.
- Writing test fixtures with exact bytes, including emoji and right-to-left text.
- Firmware and embedded work, where strings are stored as byte arrays.
- Checking string length limits. A 255-byte column fills up faster than you'd think with non-Latin scripts, since each Chinese, Japanese or Korean character is three bytes in UTF-8.
- Escaping awkward characters in a shell command or a regular expression.
Hidden characters
Copying text from a web page or a word processor can bring invisible extras. The per-character list makes them visible:
- U+00A0, a non-breaking space (
C2 A0in UTF-8), instead of a normal space; - U+200B, a zero-width space (
E2 80 8B); - U+FEFF, a byte order mark (
EF BB BF) at the start of the text; - curly quotes (U+201C and U+201D) where code expects straight
".
If a string "looks right" but fails a comparison, one of these is the usual culprit.
Hex or Base64?
Hex is easy to read but doubles the size: every byte becomes two characters. Base64 packs three bytes into four characters, a third bigger than the original. For the nine-byte Café ☕ example, that's 18 hex characters against 12 in Base64.
Choose hex when people need to read or compare the bytes, as in logs, bug reports, protocol docs and checksums. Choose Base64 when the data just has to travel safely through text, such as email attachments, data URLs and JSON payloads.
A quick check in a terminal: printf 'Café' | xxd on macOS or Linux prints the same bytes this tool shows.
Related tools
Decode bytes back into text with hex to text, which also flags invalid sequences. To see each byte's bits, use hex to binary. For a single number rather than text, use decimal to hex.
FAQ
Why is my emoji 4 bytes but some show as 7 or more?
Many emoji are sequences: a base character plus a variation selector (U+FE0F), a skin-tone modifier, or several people joined with zero-width joiners. The family emoji 👨👩👧 is five code points and 18 bytes in UTF-8.
Does it work for any language?
Yes. UTF-8 and UTF-16 cover all of Unicode, including scripts like Arabic, Devanagari and Chinese.
Is the text sent anywhere?
No. Encoding happens in your browser with the built-in TextEncoder.