One byte of binary is eight digits — a kilobyte of it is over eight thousand 0s and 1s that nobody can skim. Hexadecimal is the compact shorthand: because 16 = 2⁴, one hex digit always stands for exactly four binary digits, so every byte is exactly two hex digits. And hex changes nothing about the data — 01001000, 72 and 0x48 are the same byte spelled three ways. Hex is notation, not an encoding: encodings like ASCII and UTF-8 decide what bytes mean; hex only decides how they are written down.
The nibble trick: read hex straight off the bits
A 4-bit group is called a nibble — half a byte. To convert any binary string to hex, group it into nibbles and read each one off this table, no decimal detour needed:
| Binary | Hex | Decimal |
|---|---|---|
| 0000 | 0 | 0 |
| 0001 | 1 | 1 |
| 0010 | 2 | 2 |
| 0011 | 3 | 3 |
| 0100 | 4 | 4 |
| 0101 | 5 | 5 |
| 0110 | 6 | 6 |
| 0111 | 7 | 7 |
| 1000 | 8 | 8 |
| 1001 | 9 | 9 |
| 1010 | A | 10 |
| 1011 | B | 11 |
| 1100 | C | 12 |
| 1101 | D | 13 |
| 1110 | E | 14 |
| 1111 | F | 15 |
Worked example: 01001000 splits into 0100 and 1000 → 4 and 8 → 0x48. Decoded as text on the binary to text page, that byte is the letter H.
Where programmers see hex every day
- Color codes —
#RRGGBBis three hex bytes. This site’s own brand blue,#0F70E6, is red 0x0F (15), green 0x70 (112) and blue 0xE6 (230). - Memory addresses and error codes — debuggers print addresses in hex, and the classic joke value
0xDEADBEEFmarks freed memory on some systems precisely because it reads as English. - Unicode code points — written
U+1F44B-style: the waving hand 👋 is code point U+1F44B, while its UTF-8 bytes areF0 9F 91 8B. Same character, two hex spellings — one names the character, the other stores it.
Every byte value: 0–255 in decimal, binary and hex
The complete reference. Two hex digits per byte, always — from 0x00 to 0xFF.
| Decimal | Binary | Hex |
|---|---|---|
| 0 | 00000000 | 0x00 |
| 1 | 00000001 | 0x01 |
| 2 | 00000010 | 0x02 |
| 3 | 00000011 | 0x03 |
| 4 | 00000100 | 0x04 |
| 5 | 00000101 | 0x05 |
| 6 | 00000110 | 0x06 |
| 7 | 00000111 | 0x07 |
| 8 | 00001000 | 0x08 |
| 9 | 00001001 | 0x09 |
| 10 | 00001010 | 0x0A |
| 11 | 00001011 | 0x0B |
| 12 | 00001100 | 0x0C |
| 13 | 00001101 | 0x0D |
| 14 | 00001110 | 0x0E |
| 15 | 00001111 | 0x0F |
| 16 | 00010000 | 0x10 |
| 17 | 00010001 | 0x11 |
| 18 | 00010010 | 0x12 |
| 19 | 00010011 | 0x13 |
| 20 | 00010100 | 0x14 |
| 21 | 00010101 | 0x15 |
| 22 | 00010110 | 0x16 |
| 23 | 00010111 | 0x17 |
| 24 | 00011000 | 0x18 |
| 25 | 00011001 | 0x19 |
| 26 | 00011010 | 0x1A |
| 27 | 00011011 | 0x1B |
| 28 | 00011100 | 0x1C |
| 29 | 00011101 | 0x1D |
| 30 | 00011110 | 0x1E |
| 31 | 00011111 | 0x1F |
| 32 | 00100000 | 0x20 |
| 33 | 00100001 | 0x21 |
| 34 | 00100010 | 0x22 |
| 35 | 00100011 | 0x23 |
| 36 | 00100100 | 0x24 |
| 37 | 00100101 | 0x25 |
| 38 | 00100110 | 0x26 |
| 39 | 00100111 | 0x27 |
| 40 | 00101000 | 0x28 |
| 41 | 00101001 | 0x29 |
| 42 | 00101010 | 0x2A |
| 43 | 00101011 | 0x2B |
| 44 | 00101100 | 0x2C |
| 45 | 00101101 | 0x2D |
| 46 | 00101110 | 0x2E |
| 47 | 00101111 | 0x2F |
| 48 | 00110000 | 0x30 |
| 49 | 00110001 | 0x31 |
| 50 | 00110010 | 0x32 |
| 51 | 00110011 | 0x33 |
| 52 | 00110100 | 0x34 |
| 53 | 00110101 | 0x35 |
| 54 | 00110110 | 0x36 |
| 55 | 00110111 | 0x37 |
| 56 | 00111000 | 0x38 |
| 57 | 00111001 | 0x39 |
| 58 | 00111010 | 0x3A |
| 59 | 00111011 | 0x3B |
| 60 | 00111100 | 0x3C |
| 61 | 00111101 | 0x3D |
| 62 | 00111110 | 0x3E |
| 63 | 00111111 | 0x3F |
| 64 | 01000000 | 0x40 |
| 65 | 01000001 | 0x41 |
| 66 | 01000010 | 0x42 |
| 67 | 01000011 | 0x43 |
| 68 | 01000100 | 0x44 |
| 69 | 01000101 | 0x45 |
| 70 | 01000110 | 0x46 |
| 71 | 01000111 | 0x47 |
| 72 | 01001000 | 0x48 |
| 73 | 01001001 | 0x49 |
| 74 | 01001010 | 0x4A |
| 75 | 01001011 | 0x4B |
| 76 | 01001100 | 0x4C |
| 77 | 01001101 | 0x4D |
| 78 | 01001110 | 0x4E |
| 79 | 01001111 | 0x4F |
| 80 | 01010000 | 0x50 |
| 81 | 01010001 | 0x51 |
| 82 | 01010010 | 0x52 |
| 83 | 01010011 | 0x53 |
| 84 | 01010100 | 0x54 |
| 85 | 01010101 | 0x55 |
| 86 | 01010110 | 0x56 |
| 87 | 01010111 | 0x57 |
| 88 | 01011000 | 0x58 |
| 89 | 01011001 | 0x59 |
| 90 | 01011010 | 0x5A |
| 91 | 01011011 | 0x5B |
| 92 | 01011100 | 0x5C |
| 93 | 01011101 | 0x5D |
| 94 | 01011110 | 0x5E |
| 95 | 01011111 | 0x5F |
| 96 | 01100000 | 0x60 |
| 97 | 01100001 | 0x61 |
| 98 | 01100010 | 0x62 |
| 99 | 01100011 | 0x63 |
| 100 | 01100100 | 0x64 |
| 101 | 01100101 | 0x65 |
| 102 | 01100110 | 0x66 |
| 103 | 01100111 | 0x67 |
| 104 | 01101000 | 0x68 |
| 105 | 01101001 | 0x69 |
| 106 | 01101010 | 0x6A |
| 107 | 01101011 | 0x6B |
| 108 | 01101100 | 0x6C |
| 109 | 01101101 | 0x6D |
| 110 | 01101110 | 0x6E |
| 111 | 01101111 | 0x6F |
| 112 | 01110000 | 0x70 |
| 113 | 01110001 | 0x71 |
| 114 | 01110010 | 0x72 |
| 115 | 01110011 | 0x73 |
| 116 | 01110100 | 0x74 |
| 117 | 01110101 | 0x75 |
| 118 | 01110110 | 0x76 |
| 119 | 01110111 | 0x77 |
| 120 | 01111000 | 0x78 |
| 121 | 01111001 | 0x79 |
| 122 | 01111010 | 0x7A |
| 123 | 01111011 | 0x7B |
| 124 | 01111100 | 0x7C |
| 125 | 01111101 | 0x7D |
| 126 | 01111110 | 0x7E |
| 127 | 01111111 | 0x7F |
| 128 | 10000000 | 0x80 |
| 129 | 10000001 | 0x81 |
| 130 | 10000010 | 0x82 |
| 131 | 10000011 | 0x83 |
| 132 | 10000100 | 0x84 |
| 133 | 10000101 | 0x85 |
| 134 | 10000110 | 0x86 |
| 135 | 10000111 | 0x87 |
| 136 | 10001000 | 0x88 |
| 137 | 10001001 | 0x89 |
| 138 | 10001010 | 0x8A |
| 139 | 10001011 | 0x8B |
| 140 | 10001100 | 0x8C |
| 141 | 10001101 | 0x8D |
| 142 | 10001110 | 0x8E |
| 143 | 10001111 | 0x8F |
| 144 | 10010000 | 0x90 |
| 145 | 10010001 | 0x91 |
| 146 | 10010010 | 0x92 |
| 147 | 10010011 | 0x93 |
| 148 | 10010100 | 0x94 |
| 149 | 10010101 | 0x95 |
| 150 | 10010110 | 0x96 |
| 151 | 10010111 | 0x97 |
| 152 | 10011000 | 0x98 |
| 153 | 10011001 | 0x99 |
| 154 | 10011010 | 0x9A |
| 155 | 10011011 | 0x9B |
| 156 | 10011100 | 0x9C |
| 157 | 10011101 | 0x9D |
| 158 | 10011110 | 0x9E |
| 159 | 10011111 | 0x9F |
| 160 | 10100000 | 0xA0 |
| 161 | 10100001 | 0xA1 |
| 162 | 10100010 | 0xA2 |
| 163 | 10100011 | 0xA3 |
| 164 | 10100100 | 0xA4 |
| 165 | 10100101 | 0xA5 |
| 166 | 10100110 | 0xA6 |
| 167 | 10100111 | 0xA7 |
| 168 | 10101000 | 0xA8 |
| 169 | 10101001 | 0xA9 |
| 170 | 10101010 | 0xAA |
| 171 | 10101011 | 0xAB |
| 172 | 10101100 | 0xAC |
| 173 | 10101101 | 0xAD |
| 174 | 10101110 | 0xAE |
| 175 | 10101111 | 0xAF |
| 176 | 10110000 | 0xB0 |
| 177 | 10110001 | 0xB1 |
| 178 | 10110010 | 0xB2 |
| 179 | 10110011 | 0xB3 |
| 180 | 10110100 | 0xB4 |
| 181 | 10110101 | 0xB5 |
| 182 | 10110110 | 0xB6 |
| 183 | 10110111 | 0xB7 |
| 184 | 10111000 | 0xB8 |
| 185 | 10111001 | 0xB9 |
| 186 | 10111010 | 0xBA |
| 187 | 10111011 | 0xBB |
| 188 | 10111100 | 0xBC |
| 189 | 10111101 | 0xBD |
| 190 | 10111110 | 0xBE |
| 191 | 10111111 | 0xBF |
| 192 | 11000000 | 0xC0 |
| 193 | 11000001 | 0xC1 |
| 194 | 11000010 | 0xC2 |
| 195 | 11000011 | 0xC3 |
| 196 | 11000100 | 0xC4 |
| 197 | 11000101 | 0xC5 |
| 198 | 11000110 | 0xC6 |
| 199 | 11000111 | 0xC7 |
| 200 | 11001000 | 0xC8 |
| 201 | 11001001 | 0xC9 |
| 202 | 11001010 | 0xCA |
| 203 | 11001011 | 0xCB |
| 204 | 11001100 | 0xCC |
| 205 | 11001101 | 0xCD |
| 206 | 11001110 | 0xCE |
| 207 | 11001111 | 0xCF |
| 208 | 11010000 | 0xD0 |
| 209 | 11010001 | 0xD1 |
| 210 | 11010010 | 0xD2 |
| 211 | 11010011 | 0xD3 |
| 212 | 11010100 | 0xD4 |
| 213 | 11010101 | 0xD5 |
| 214 | 11010110 | 0xD6 |
| 215 | 11010111 | 0xD7 |
| 216 | 11011000 | 0xD8 |
| 217 | 11011001 | 0xD9 |
| 218 | 11011010 | 0xDA |
| 219 | 11011011 | 0xDB |
| 220 | 11011100 | 0xDC |
| 221 | 11011101 | 0xDD |
| 222 | 11011110 | 0xDE |
| 223 | 11011111 | 0xDF |
| 224 | 11100000 | 0xE0 |
| 225 | 11100001 | 0xE1 |
| 226 | 11100010 | 0xE2 |
| 227 | 11100011 | 0xE3 |
| 228 | 11100100 | 0xE4 |
| 229 | 11100101 | 0xE5 |
| 230 | 11100110 | 0xE6 |
| 231 | 11100111 | 0xE7 |
| 232 | 11101000 | 0xE8 |
| 233 | 11101001 | 0xE9 |
| 234 | 11101010 | 0xEA |
| 235 | 11101011 | 0xEB |
| 236 | 11101100 | 0xEC |
| 237 | 11101101 | 0xED |
| 238 | 11101110 | 0xEE |
| 239 | 11101111 | 0xEF |
| 240 | 11110000 | 0xF0 |
| 241 | 11110001 | 0xF1 |
| 242 | 11110010 | 0xF2 |
| 243 | 11110011 | 0xF3 |
| 244 | 11110100 | 0xF4 |
| 245 | 11110101 | 0xF5 |
| 246 | 11110110 | 0xF6 |
| 247 | 11110111 | 0xF7 |
| 248 | 11111000 | 0xF8 |
| 249 | 11111001 | 0xF9 |
| 250 | 11111010 | 0xFA |
| 251 | 11111011 | 0xFB |
| 252 | 11111100 | 0xFC |
| 253 | 11111101 | 0xFD |
| 254 | 11111110 | 0xFE |
| 255 | 11111111 | 0xFF |
Common mistakes
- Mistake: grouping by 8 instead of 4. Hex digits line up with nibbles, not bytes — treating
11110110as one chunk forces a decimal detour. Correction: split into1111and0110first, then read F and 6 →0xF6. - Mistake: worrying about letter case in hex.
0xF6and0xf6are the same value. Correction: case is convention, not content — this site prints uppercase, C code often uses lowercase. - Mistake: treating the 0x prefix as part of the value. Correction:
0xis a C-style marker meaning “hex follows”; it carries no value, just like the0bprefix on binary.
Practice
1. Convert 11110110 to hex without touching decimal. Split into nibbles 1111 and 0110 → F and 6 → 0xF6.
2. What is the byte 0x48 in binary — and as a letter? 4 = 0100 and 8 = 1000, so 01001000; decoded as ASCII text that is H. Verify both in the converter above.