What hexadecimal is
Hexadecimal (base 16) uses sixteen digits: 0–9 and then A–F for ten to fifteen. Because 16 is 2⁴, one hex digit stands for exactly four bits and two hex digits for one byte. That makes hex the standard shorthand for raw bytes in programming, network dumps, colour codes and file formats — far easier to read than a long run of binary. RFC 4648 §8 calls this encoding Base16.
| Hex | Decimal | Binary | Hex | Decimal | Binary |
|---|---|---|---|---|---|
0 | 0 | 0000 | 8 | 8 | 1000 |
1 | 1 | 0001 | 9 | 9 | 1001 |
2 | 2 | 0010 | A | 10 | 1010 |
3 | 3 | 0011 | B | 11 | 1011 |
4 | 4 | 0100 | C | 12 | 1100 |
5 | 5 | 0101 | D | 13 | 1101 |
6 | 6 | 0110 | E | 14 | 1110 |
7 | 7 | 0111 | F | 15 | 1111 |
How the converter works
Going from text to hex, each character is encoded as UTF-8 bytes (the encoding used by most web pages and files) and each byte is written as two hex digits. Basic English letters and punctuation are one byte each, identical to ASCII. Accented letters take two bytes, symbols such as € take three, and emoji take four. Going from hex to text, the converter strips prefixes and separators, pairs up the digits, and decodes the bytes as UTF-8. If the bytes are not valid UTF-8 — perhaps they are an image, or text in another encoding — you see � and a clear warning rather than mystery characters.
Worked example: “Code”
| Character | Decimal | Hex | Binary |
|---|---|---|---|
| C | 67 | 43 | 01000011 |
| o | 111 | 6F | 01101111 |
| d | 100 | 64 | 01100100 |
| e | 101 | 65 | 01100101 |
Take the first byte, 43. The left digit counts sixteens and the right digit counts ones: 4 × 16 + 3 = 67, the code for “C”. Each hex digit also maps directly onto four bits, so 4 = 0100 and 3 = 0011, which together make the binary byte in the last column.
Formats you can paste
- Plain pairs:
48 65 6C 6C 6For48656c6c6f - C / JavaScript style:
0x48, 0x65, 0x6C - Escape sequences:
\x48\x65\x6c - MAC-address style:
48:65:6C:6C:6F
Case does not matter, and line breaks are fine. When encoding, choose a separator and prefix to match the format you need, and tick Lowercase for output like 0x6c.
Hex is not encryption
Hex only changes how bytes are written, not what they are, so anyone can read hex-encoded text with a tool like this one. If you need to hide a message, see the Caesar or Vigenère ciphers (for puzzles — neither is secure for real secrets). For related conversions try the binary translator, the ASCII converter and the full ASCII table with hex values.
Hex you already use
- Web colours.
#FF6600is three bytes — red FF (255), green 66 (102) and blue 00 (0) — which is why each colour channel runs from 00 to FF. - Unicode code points are written in hex: é is U+00E9 and € is U+20AC. Note that a code point is not the same as its UTF-8 bytes — € is U+20AC but its bytes are
E2 82 AC. - Network hardware addresses (MAC addresses) are six bytes written as hex pairs separated by colons, a format this converter accepts.
Converting hex to text by hand
- Split the hex into pairs:
48 69. - Convert each pair: the first digit × 16 plus the second digit, with A–F meaning 10–15. 4 × 16 + 8 = 72 and 6 × 16 + 9 = 105.
- Look up the numbers in an ASCII table: 72 is H and 105 is i, so the text is “Hi”.
Why exactly two digits per byte
A byte holds 256 values, from 0 to 255. Two hex digits give 16 × 16 = 256 combinations, from 00 to FF, so every byte fits in exactly two digits — no more, no less. That is why the converter pads small values with a leading zero (a line feed, code 10, is 0A, not A) and why an odd number of digits always means something is missing. Upper and lower case mean the same thing: 4F and 4f are both 79. Choose whichever your code style or file format expects.