0xCONVERTER-HEX

Characters → bytes

ASCII to Hex Converter

Encode text as hexadecimal byte pairs, formatted for a dump, a literal or a protocol field.

Text in

Hex

Decimal bytes

Binary

How text becomes hex

  1. Take each character in turn, left to right.
  2. Find its ASCII code — the number the character is stored as.
  3. Write that number as two hex digits, padding with a leading zero if needed.
  4. 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.

FormatLooks likeUsed in
Unbroken48656C6C6FHashes, protocol fields, database columns
Spaced48 65 6C 6C 6FHex dumps, documentation, packet captures
Lower case48656c6c6fGit, hashes, CSS, most modern codebases
Upper case48656C6C6FAssembly, 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

CharactersHex rangeDecimal range
Control codes00–1F0–31
Space2032
Punctuation21–2F33–47
Digits 0–930–3948–57
Capitals A–Z41–5A65–90
Lower case a–z61–7A97–122
DEL7F127

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.