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:

BinaryHexDecimal
000000
000111
001022
001133
010044
010155
011066
011177
100088
100199
1010A10
1011B11
1100C12
1101D13
1110E14
1111F15

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#RRGGBB is 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 0xDEADBEEF marks 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 are F0 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.

DecimalBinaryHex
0000000000x00
1000000010x01
2000000100x02
3000000110x03
4000001000x04
5000001010x05
6000001100x06
7000001110x07
8000010000x08
9000010010x09
10000010100x0A
11000010110x0B
12000011000x0C
13000011010x0D
14000011100x0E
15000011110x0F
16000100000x10
17000100010x11
18000100100x12
19000100110x13
20000101000x14
21000101010x15
22000101100x16
23000101110x17
24000110000x18
25000110010x19
26000110100x1A
27000110110x1B
28000111000x1C
29000111010x1D
30000111100x1E
31000111110x1F
32001000000x20
33001000010x21
34001000100x22
35001000110x23
36001001000x24
37001001010x25
38001001100x26
39001001110x27
40001010000x28
41001010010x29
42001010100x2A
43001010110x2B
44001011000x2C
45001011010x2D
46001011100x2E
47001011110x2F
48001100000x30
49001100010x31
50001100100x32
51001100110x33
52001101000x34
53001101010x35
54001101100x36
55001101110x37
56001110000x38
57001110010x39
58001110100x3A
59001110110x3B
60001111000x3C
61001111010x3D
62001111100x3E
63001111110x3F
64010000000x40
65010000010x41
66010000100x42
67010000110x43
68010001000x44
69010001010x45
70010001100x46
71010001110x47
72010010000x48
73010010010x49
74010010100x4A
75010010110x4B
76010011000x4C
77010011010x4D
78010011100x4E
79010011110x4F
80010100000x50
81010100010x51
82010100100x52
83010100110x53
84010101000x54
85010101010x55
86010101100x56
87010101110x57
88010110000x58
89010110010x59
90010110100x5A
91010110110x5B
92010111000x5C
93010111010x5D
94010111100x5E
95010111110x5F
96011000000x60
97011000010x61
98011000100x62
99011000110x63
100011001000x64
101011001010x65
102011001100x66
103011001110x67
104011010000x68
105011010010x69
106011010100x6A
107011010110x6B
108011011000x6C
109011011010x6D
110011011100x6E
111011011110x6F
112011100000x70
113011100010x71
114011100100x72
115011100110x73
116011101000x74
117011101010x75
118011101100x76
119011101110x77
120011110000x78
121011110010x79
122011110100x7A
123011110110x7B
124011111000x7C
125011111010x7D
126011111100x7E
127011111110x7F
128100000000x80
129100000010x81
130100000100x82
131100000110x83
132100001000x84
133100001010x85
134100001100x86
135100001110x87
136100010000x88
137100010010x89
138100010100x8A
139100010110x8B
140100011000x8C
141100011010x8D
142100011100x8E
143100011110x8F
144100100000x90
145100100010x91
146100100100x92
147100100110x93
148100101000x94
149100101010x95
150100101100x96
151100101110x97
152100110000x98
153100110010x99
154100110100x9A
155100110110x9B
156100111000x9C
157100111010x9D
158100111100x9E
159100111110x9F
160101000000xA0
161101000010xA1
162101000100xA2
163101000110xA3
164101001000xA4
165101001010xA5
166101001100xA6
167101001110xA7
168101010000xA8
169101010010xA9
170101010100xAA
171101010110xAB
172101011000xAC
173101011010xAD
174101011100xAE
175101011110xAF
176101100000xB0
177101100010xB1
178101100100xB2
179101100110xB3
180101101000xB4
181101101010xB5
182101101100xB6
183101101110xB7
184101110000xB8
185101110010xB9
186101110100xBA
187101110110xBB
188101111000xBC
189101111010xBD
190101111100xBE
191101111110xBF
192110000000xC0
193110000010xC1
194110000100xC2
195110000110xC3
196110001000xC4
197110001010xC5
198110001100xC6
199110001110xC7
200110010000xC8
201110010010xC9
202110010100xCA
203110010110xCB
204110011000xCC
205110011010xCD
206110011100xCE
207110011110xCF
208110100000xD0
209110100010xD1
210110100100xD2
211110100110xD3
212110101000xD4
213110101010xD5
214110101100xD6
215110101110xD7
216110110000xD8
217110110010xD9
218110110100xDA
219110110110xDB
220110111000xDC
221110111010xDD
222110111100xDE
223110111110xDF
224111000000xE0
225111000010xE1
226111000100xE2
227111000110xE3
228111001000xE4
229111001010xE5
230111001100xE6
231111001110xE7
232111010000xE8
233111010010xE9
234111010100xEA
235111010110xEB
236111011000xEC
237111011010xED
238111011100xEE
239111011110xEF
240111100000xF0
241111100010xF1
242111100100xF2
243111100110xF3
244111101000xF4
245111101010xF5
246111101100xF6
247111101110xF7
248111110000xF8
249111110010xF9
250111110100xFA
251111110110xFB
252111111000xFC
253111111010xFD
254111111100xFE
255111111110xFF

Common mistakes

  • Mistake: grouping by 8 instead of 4. Hex digits line up with nibbles, not bytes — treating 11110110 as one chunk forces a decimal detour. Correction: split into 1111 and 0110 first, then read F and 6 → 0xF6.
  • Mistake: worrying about letter case in hex. 0xF6 and 0xf6 are 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: 0x is a C-style marker meaning “hex follows”; it carries no value, just like the 0b prefix 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.