Text to Hex Converter
To convert text to hex, encode each character as bytes and write each byte as two hex digits. ASCII characters take one byte, so hello is 68 65 6C 6C 6F. In UTF-8, Cyrillic letters take two bytes each (Привет is D0 9F D1 80 D0 B8 D0 B2 D0 B5 D1 82) and most emoji take four.
5 bytes, 5 characters.
Hex to textCharacter breakdown
| Char | Code point | Bytes | Count |
|---|---|---|---|
| h | U+0068 | 68 | 1 |
| e | U+0065 | 65 | 1 |
| l | U+006C | 6C | 1 |
| l | U+006C | 6C | 1 |
| o | U+006F | 6F | 1 |
How to turn text into hex bytes
Computers store characters as numbers, and hex is the usual way to look at those numbers directly. You need hex text when you build a test payload, compare what two systems actually sent, write a byte array into code or check that a string carries no hidden characters.
- Pick the encoding: ASCII for plain English text, UTF-8 for anything else.
- Find each character’s code point, its number in Unicode.
- Encode the code point as one to four bytes following the UTF-8 rules.
- Write every byte as two hex digits, with the separator your target expects.
A space is a byte too, 20, and so is a line break, 0A. The character list under the tool shows them by name so nothing invisible slips into the output unnoticed.
Worked example: Привет
Six Cyrillic letters, two bytes each
Привет → D0 9F D1 80 D0 B8 D0 B2 D0 B5 D1 82
| Char | Code point | Bytes | Count |
|---|---|---|---|
| П | U+041F | D0 9F | 2 |
| р | U+0440 | D1 80 | 2 |
| и | U+0438 | D0 B8 | 2 |
| в | U+0432 | D0 B2 | 2 |
| е | U+0435 | D0 B5 | 2 |
| т | U+0442 | D1 82 | 2 |
Choosing an output format
The bytes never change; only the punctuation around them does. Pick the format your destination parses, so the result can be pasted without editing. Lowercase digits are common in hashes and Unix tools; uppercase reads better in tables and documentation.
| Format | Output | Where it fits |
|---|---|---|
| Spaced | 48 69 21 | reading, hex editors, bug reports |
| Plain | 486921 | hashes, keys, compact storage |
| 0x each | 0x48 0x69 0x21 | assembly listings, documentation |
| Escaped | \x48\x69\x21 | string literals in C, Python, shells |
| Comma list | 0x48, 0x69, 0x21 | byte arrays in C, Rust, Java |
Why an emoji takes four bytes
UTF-8 spends bytes according to the size of the code point. Up to U+007F fits in one byte, up to U+07FF in two, up to U+FFFF in three. Emoji were added above that line, so they need the four-byte form, which has room for 21 bits. The ranges and bit layout are set out in RFC 3629.
Encoding 😀 by hand: write U+1F600 in 21 bits, split them 3 + 6 + 6 + 6, and put 11110 in front of the first part and 10 in front of each of the others. Some emoji are several code points joined together, a family or a flag, so they can run to a dozen bytes or more.
| Stage | Bits | Hex |
|---|---|---|
| Code point | 1 1111 0110 0000 0000 | U+1F600 |
| Split 3 + 6 + 6 + 6 | 000 011111 011000 000000 | |
| With UTF-8 markers | 11110000 10011111 10011000 10000000 | F0 9F 98 80 |
Questions people ask
How do you say hello in hexadecimal?
In ASCII or UTF-8, hello is 68 65 6C 6C 6F: h is 68, e is 65, l is 6C and o is 6F. With a capital H, Hello starts with 48 instead.
Why is an emoji four bytes in UTF-8?
UTF-8 needs four bytes for code points above U+FFFF, and most emoji live there. 😀 is U+1F600, which UTF-8 writes as F0 9F 98 80. In UTF-16 the same emoji takes two 16-bit units, a surrogate pair.
Is ASCII hex the same as UTF-8 hex?
For the 128 ASCII characters, yes: UTF-8 was designed so that bytes 00 to 7F mean the same thing. They differ only for other characters, which ASCII cannot encode and UTF-8 writes as two to four bytes.
How many bytes does a Cyrillic letter take in UTF-8?
Two. Cyrillic letters sit between U+0400 and U+04FF, a range UTF-8 encodes in two bytes, so the six letters of Привет become twelve bytes.
Related conversions
Last updated