Characters → bytes
ASCII to Hex Converter
Encode text as hexadecimal byte pairs, formatted for a dump, a literal or a protocol field.
—
—
—
How text becomes hex
- Take each character in turn, left to right.
- Find its ASCII code — the number the character is stored as.
- Write that number as two hex digits, padding with a leading zero if needed.
- Join the pairs. One character in, exactly two hex digits out.
Worked example
Hello H → 72 → 48 e → 101 → 65 l → 108 → 6C l → 108 → 6C o → 111 → 6F result → 48656C6C6F
The padding rule that trips people up
Every byte must be two digits. A tab is code 9, which is 9 in hex — but it
must be written 09, not 9. Drop that zero and the byte boundaries shift,
and everything after it decodes wrongly.
correct tab + A → 09 41 wrong tab + A → 9 41 → reads as 94 1? — misaligned
This converter always pads, which is why a string of n characters always produces exactly 2n hex digits.
Output formats and where each one goes
The same bytes get written several ways depending on the destination, and picking the wrong format is a common source of wasted time.
| Format | Looks like | Used in |
|---|---|---|
| Unbroken | 48656C6C6F | Hashes, protocol fields, database columns |
| Spaced | 48 65 6C 6C 6F | Hex dumps, documentation, packet captures |
| Lower case | 48656c6c6f | Git, hashes, CSS, most modern codebases |
| Upper case | 48656C6C6F | Assembly, hardware docs, memory listings |
The value is identical in every row. Only the presentation changes, so choose whichever your destination parses without complaint.
ASCII landmarks
| Characters | Hex range | Decimal range |
|---|---|---|
| Control codes | 00–1F | 0–31 |
| Space | 20 | 32 |
| Punctuation | 21–2F | 33–47 |
| Digits 0–9 | 30–39 | 48–57 |
| Capitals A–Z | 41–5A | 65–90 |
| Lower case a–z | 61–7A | 97–122 |
| DEL | 7F | 127 |
Every code is listed in the ASCII hex table. Digits are the easiest range to recall: the hex code for a digit is always 3
followed by the digit itself. 7 is 37, 0 is 30.
That single rule covers ten characters.
When your text is not really ASCII
ASCII covers 128 codes, and that is all it covers. Accented letters, curly quotes, currency symbols beyond the dollar, emoji and every non-Latin script fall outside it entirely.
If you paste any of those here, the converter tells you how many characters sit above
7F. For anything modern you almost certainly want
text to hex, which encodes as UTF-8 and represents those characters
correctly using two, three or four bytes each.
Frequently asked questions
How do I convert ASCII to hex?
Replace each character with its ASCII code written as two hex digits. H is 72, which is 48 in hex.
What is Hello in hex?
48656C6C6F, or 48 65 6C 6C 6F with spaces between the bytes.
Why does every byte need two digits?
So byte boundaries stay fixed. Writing a tab as 9 instead of 09 shifts everything after it and corrupts the decoding.
Should hex output be upper or lower case?
The value is the same either way. Upper case is conventional in hex dumps and assembly, lower case in hashes, Git and CSS.
What happens to accented characters and emoji?
They are outside ASCII. The converter flags them; use the text to hex converter, which encodes as UTF-8, for anything beyond the 128 ASCII codes.
Does a space become a hex value?
Yes. Space is character code 32, which is 20 in hex. It is a real byte like any other.