Return
to tool
Numbers & Bases

Binary to Hexadecimal Converter

Convert binary to hexadecimal by the rule the whole thing rests on: four binary digits make exactly one hex digit. Group your bits into fours from the right, and each group becomes a single character. The converter below works in both directions, shows the grouping live as you type, marks byte boundaries, and handles binary fractions. Below it you'll find the nibble table worth memorising, a byte reference chart, and worked examples for the values people actually look up.

Binary ↔ Hexadecimal

Type in either field. The other updates live, with the nibble grouping drawn below.

Accepts up to 64 bits before the point and 24 after. Spaces and underscores are fine.

Why four bits make one hex digit

Hexadecimal is base 16, and 16 is 2 to the fourth power. That is the entire reason the conversion is easy. Four binary digits produce exactly sixteen possible patterns — 0000 through 1111 — and hex has exactly sixteen digits, 0 through 9 then A through F. The mapping is one-to-one with nothing left over.

So converting binary to hexadecimal never involves arithmetic. You are not calculating anything; you are relabelling. Chop the bits into fours, look each group up, write the character down. Converting binary to decimal is genuinely harder, because ten is not a power of two and the conversion needs real division. This is why hex, not decimal, is what you see whenever anyone is working close to the machine.

A four-bit group has a name: a nibble. Two nibbles make a byte, which is why a byte is always exactly two hex digits, and why hex is the natural way to write raw data. A 32-bit value that would sprawl across thirty-two ones and zeros collapses into eight characters you can read at a glance and say out loud.

Binary nibbleHex digitDecimalOctal
0000000
0001111
0010222
0011333
0100444
0101555
0110666
0111777
10008810
10019911
1010A1012
1011B1113
1100C1214
1101D1315
1110E1416
1111F1517

How to convert binary to hexadecimal, step by step

  1. Start from the rightmost bit — the one nearest the point, not the leftmost.
  2. Split the digits into groups of four, working right to left.
  3. If the leftmost group comes up short, pad it on the left with zeros until it has four digits. Leading zeros never change the value.
  4. Convert each 4-bit group to its hex digit using the nibble table above.
  5. Write the digits in the same left-to-right order as their groups.

Direction is where people go wrong. Grouping from the left instead of the right produces a wrong answer any time the bit count is not already a multiple of four. Binary 101101 grouped from the left gives 1011 and 01, which reads as B1 — but grouped correctly from the right it gives 0010 and 1101, which is 2D. Check it in decimal: 101101 is 45, and 2D is (2 x 16) + 13 = 45. B1 would be 177, which is nowhere close.

Worked examples

Convert 101101 to hexadecimal

101101 has six bits, which is not a multiple of four, so pad it on the left with two zeros to make 00101101. Split from the right into 0010 and 1101. From the nibble table, 0010 is 2 and 1101 is D. So 101101 in binary is 2D in hexadecimal. Decimal check: 45 both ways.

StageValue
Original binary101101
Padded to a multiple of 400101101
Split into groups from the right0010 | 1101
Each group as a hex digit2 | D
Result2D
Decimal check45

Convert 11111111 to hexadecimal

Eight bits — one full byte, and the largest value a byte can hold. It splits cleanly with no padding into 1111 and 1111, giving F and F. So 11111111 is FF, which is 255 in decimal. This is the value you see constantly in colour codes and byte fields precisely because it is the ceiling of a single byte.

Convert 1011111011101111 to hexadecimal

Sixteen bits, so four clean nibbles and no padding: 1011, 1110, 1110, 1111. Those map to B, E, E and F, giving BEEF — a real hex value and a long-running programmer joke, used as a recognisable filler pattern in memory. In decimal it is 48,879. Sixteen binary digits reduced to four characters is the compression that makes hex worth using.

BinaryGroups of 4HexDecimal
10101010A10
11111111F15
101110001 | 01111723
1011010010 | 11012D45
1101010011 | 01013553
10000000100 | 00004064
101010101010 | 1010AA170
110010101100 | 1010CA202
111111111111 | 1111FF255
1000000000001 | 0000 | 0000100256
1101000010101101 | 0000 | 1010D0A3338
10111110111011111011 | 1110 | 1110 | 1111BEEF48879

Converting hexadecimal back to binary

The reverse direction is easier because there is no padding decision. Replace each hex digit with its four binary digits, keep the order, then drop any leading zeros at the very end. Hex 2D becomes 0010 and 1101, which reads 00101101, which is 101101 once the leading zeros go.

The rule people forget is that every digit expands to exactly four bits, including small ones. Hex 5 is 0101, and in the middle of a number it must stay as the full 0101. Hex 41 is 01000001, not 1000001. Only the leading zeros of the whole result get dropped, never the ones inside. Use the swap button on the converter to go this direction without retyping.

HexDigit-by-digit expansionBinary result
F11111111
100001 000010000
2D0010 1101101101
350011 0101110101
410100 00011000001
7F0111 11111111111
801000 000010000000
AA1010 101010101010
FF1111 111111111111
1000001 0000 0000100000000
D0A1101 0000 1010110100001010
BEEF1011 1110 1110 11111011111011101111

Nibbles, bytes and why hex won

A nibble is four bits and a byte is eight, so a byte is always exactly two hex digits — never one, never three. That fixed relationship is why hex became the standard way to write raw data and why octal, which groups in threes, largely fell out of use. Three does not divide eight, so a byte in octal takes an awkward three digits with the top one only partly used. Four divides eight perfectly.

This is worth internalising because it makes hex readable at a glance. Every pair of characters is one byte. A four-character hex value is two bytes, or a 16-bit word. Eight characters is four bytes, a 32-bit value. When you see an address like 0x7FFF5FBF you can immediately count four bytes without doing any arithmetic. Set the grouping control on the converter above to Byte and the visualiser will draw those boundaries for you.

BitsNibblesBytesHex digitsMax unsigned valueMax in hex
410.5115F
8212255FF
1231.534,095FFF
1642465,535FFFF
2463616,777,215FFFFFF
328484,294,967,295FFFFFFFF
4812612281,474,976,710,655FFFFFFFFFFFF
641681618,446,744,073,709,551,615FFFFFFFFFFFFFFFF

Binary fractions and the point

Bits after a binary point convert just as cleanly, but the padding direction reverses. Before the point you pad on the left; after it you pad on the right. Place values radiate outward from the point in both directions, so the group nearest the point is the one that must stay complete.

Take 0.11. Two fractional bits, so pad right to 0.1100, which is one nibble: 1100, or hex C. So 0.11 binary is 0.C hex. Check it: 0.11 binary is 0.75, and C is 12, and 12/16 is 0.75. Now 1010.11 — the integer part 1010 is one complete nibble giving A, and the fractional part pads to 1100 giving C, so the answer is A.C. None of the pages ranking for this term accept a binary point at all.

BinaryPaddedGroupsHexDecimal check
0.10.100010000.80.5
0.010.010001000.40.25
0.110.110011000.C0.75
0.1010.101010100.A0.625
0.1110.111011100.E0.875
0.00010.000100010.10.0625
0.11110.111111110.F0.9375
0.1111110.1111 11001111 | 11000.FC0.984375
1.10001.10000001 | 10001.81.5
10.010010.01000010 | 01002.42.25
1010.111010.11001010 | 1100A.C10.75
11111111.111111111.10001111 1111 | 1000FF.8255.5

Reference charts

Byte values in binary and hex

Every value a single byte can hold, in binary and hex. These are the conversions that come up most, because a byte is the unit almost everything else is built from — one colour channel, one ASCII character, one register field.

DecimalBinaryHexComes up as
00000000000Null byte, black channel
10000000101Low flag bit
20000001002
30000001103
40000010004
50000010105
60000011006
70000011107
80000100008
90000100109
10000010100ANewline
11000010110B
12000011000C
13000011010DCarriage return
14000011100E
15000011110FLow nibble full
160001000010One nibble carry
170001000111
180001001012
190001001113
200001010014
210001010115
220001011016
230001011117
240001100018
250001100119
26000110101A
27000110111B
28000111001C
29000111011D
30000111101E
31000111111F
320010000020ASCII space
330010000121
340010001022
350010001123
360010010024
370010010125
380010011026
390010011127
400010100028
410010100129
42001010102A
43001010112B
44001011002C
45001011012DASCII hyphen
46001011102E
47001011112F
480011000030ASCII '0'
490011000131
500011001032
510011001133
520011010034
530011010135ASCII '5'
540011011036
550011011137
560011100038
570011100139
58001110103A
59001110113B
60001111003C
61001111013D
62001111103E
63001111113FASCII '?'
640100000040ASCII '@'
650100000141ASCII 'A'
660100001042
670100001143
680100010044
690100010145
700100011046
710100011147
720100100048ASCII 'H'
730100100149
74010010104A
75010010114B
76010011004C
77010011014D
78010011104E
79010011114F
800101000050
810101000151
820101001052
830101001153
840101010054
850101010155
860101011056
870101011157
880101100058
890101100159
90010110105AASCII 'Z'
91010110115B
92010111005C
93010111015D
94010111105E
95010111115F
960110000060
970110000161ASCII 'a'
980110001062
990110001163
1000110010064ASCII 'd'
1010110010165
1020110011066
1030110011167
1040110100068
1050110100169
106011010106A
107011010116B
108011011006C
109011011016D
110011011106E
111011011116F
1120111000070
1130111000171
1140111001072
1150111001173
1160111010074
1170111010175
1180111011076
1190111011177
1200111100078
1210111100179
122011110107AASCII 'z'
123011110117B
124011111007C
125011111017D
126011111107E
127011111117FMax signed byte
1281000000080Min signed byte; mid grey
1291000000181
1301000001082
1311000001183
1321000010084
1331000010185
1341000011086
1351000011187
1361000100088
1371000100189
138100010108A
139100010118B
140100011008C
141100011018D
142100011108E
143100011118F
1441001000090
1451001000191
1461001001092
1471001001193
1481001010094
1491001010195
1501001011096
1511001011197
1521001100098
1531001100199
154100110109A
155100110119B
156100111009C
157100111019D
158100111109E
159100111119F
16010100000A0Non-breaking space
16110100001A1
16210100010A2
16310100011A3
16410100100A4
16510100101A5
16610100110A6
16710100111A7
16810101000A8
16910101001A9
17010101010AAAlternating bit pattern
17110101011AB
17210101100AC
17310101101AD
17410101110AE
17510101111AF
17610110000B0
17710110001B1
17810110010B2
17910110011B3
18010110100B4
18110110101B5
18210110110B6
18310110111B7
18410111000B8
18510111001B9
18610111010BA
18710111011BB
18810111100BC
18910111101BD
19010111110BE
19110111111BF
19211000000C0Top two bits set
19311000001C1
19411000010C2
19511000011C3
19611000100C4
19711000101C5
19811000110C6
19911000111C7
20011001000C8
20111001001C9
20211001010CA
20311001011CB
20411001100CCRepeating nibble
20511001101CD
20611001110CE
20711001111CF
20811010000D0
20911010001D1
21011010010D2
21111010011D3
21211010100D4
21311010101D5
21411010110D6
21511010111D7
21611011000D8JPEG marker byte
21711011001D9
21811011010DA
21911011011DB
22011011100DC
22111011101DD
22211011110DE
22311011111DF
22411100000E0
22511100001E1
22611100010E2
22711100011E3
22811100100E4
22911100101E5
23011100110E6
23111100111E7
23211101000E8
23311101001E9
23411101010EA
23511101011EB
23611101100EC
23711101101ED
23811101110EE
23911101111EF
24011110000F0High nibble full
24111110001F1
24211110010F2
24311110011F3
24411110100F4
24511110101F5
24611110110F6
24711110111F7
24811111000F8
24911111001F9
25011111010FA
25111111011FB
25211111100FC
25311111101FD
25411111110FE
25511111111FFMax byte; full channel

Prefer starting from decimal? The decimal to hex converter covers the division method this substitution page skips.

Wider binary, hex, decimal and octal reference

BinaryHexDecimalOctal
0000
1111
10222
11333
100444
101555
110666
111777
10008810
10019911
1010A1012
1011B1113
1100C1214
1101D1315
1110E1416
1111F1517
10000101620
10101152125
11000182430
111111F3137
100000203240
1010102A4252
1011012D4555
110000304860
110101355365
1111113F6377
10000004064100
10101015585125
110010064100144
11111117F127177
1000000080128200
10101010AA170252
11000000C0192300
11001000C8200310
11111010FA250372
11111111FF255377
100000000100256400
1111101001F4500764
10000000002005121000
11111010003E810001750
1000000000040010242000
111111111111FFF40957777
10000000000001000409610000
1111111111111111FFFF65535177777

Powers of 16 and bit positions

Hex positionPlace value16^nBit range covered
0116^0bits 0-3
11616^1bits 4-7
225616^2bits 8-11
34,09616^3bits 12-15
465,53616^4bits 16-19
51,048,57616^5bits 20-23
616,777,21616^6bits 24-27
7268,435,45616^7bits 28-31
84,294,967,29616^8bits 32-35

Where you'll meet binary and hex together

Hex exists to make binary readable, so the two almost always turn up in the same places. Knowing which one you are looking at, and being able to move between them, is most of the skill.

Hex dumps and file signatures

Open any file in a hex editor and you get bytes in hex, two characters each. The first few bytes usually identify the file type. A PNG starts 89 50 4E 47 — in binary that is 10001001 01010000 01001110 01000111, which is far harder to recognise. A JPEG opens FF D8 FF, a ZIP opens 50 4B 03 04, and an ELF binary opens 7F 45 4C 46. Three of those four spell something in ASCII once converted: PK for Phil Katz who wrote the ZIP format, and ELF and PNG for themselves.

File typeHex signatureBinary (first byte)ASCII
PNG89 50 4E 4710001001.PNG
JPEGFF D8 FF11111111
PDF25 50 44 4600100101%PDF
GIF47 49 46 3801000111GIF8
ZIP50 4B 03 0401010000PK..
ELF7F 45 4C 4601111111.ELF
Java classCA FE BA BE11001010
BMP42 4D01000010BM

Bitmasks and flags

When a single value packs several on/off settings, each bit is one flag and hex is how the packed value gets written. A mask of 0x0F is 00001111 — the low four bits on, the high four off, which is how you isolate a nibble. 0xF0 is the opposite. Reading a flags value means converting it to binary and looking at which positions are set, which is exactly what the visualiser above shows you.

Colour channels

A CSS colour is three bytes, one per channel, written as six hex digits. Each channel therefore runs 00 to FF, or 00000000 to 11111111 in binary. #FF0000 is red at maximum with the other channels off. Because a channel is exactly one byte, it is exactly two hex digits — the same nibble arithmetic, applied three times.

Memory addresses and registers

Debuggers and crash logs print addresses in hex because the four-bit alignment makes structure visible. Round hex numbers mark real boundaries: 0x1000 is 4,096, one memory page. Register values are often easiest to read as binary when you care about individual bits and as hex when you care about the whole word, which is why moving between the two quickly is a practical skill rather than an academic one.

Who uses this and why

Computer science students

Base conversion is standard coursework and it is assessed by hand, so seeing the method matters more than getting the answer. The visualiser shows the padding and the split explicitly, which is where marks are lost — grouping from the wrong end, or dropping a zero from a middle nibble.

Software developers

Reading bitmasks, checking flag values, interpreting register contents and decoding hex literals in unfamiliar code. The byte grouping view matters here: knowing at a glance whether a value is one byte, two or four determines whether it can overflow.

Security researchers and reverse engineers

Hex dumps are the native format for inspecting binaries, packet captures and file formats. Recognising signatures, spotting padding patterns and converting specific offsets to binary to examine individual bits are all daily operations.

Embedded and hardware engineers

Datasheets specify register maps in hex but describe individual bits in binary, so the conversion happens constantly. A configuration byte written as 0xB4 has to become 10110100 before you can tell which features it enables.

Web designers

Colour work is byte arithmetic whether or not it feels like it. Understanding that each channel is one byte, two hex digits, explains why values run 00 to FF and why #808080 is the midpoint grey.

Frequently Asked Questions

How do you convert binary to hexadecimal?

Group the binary digits into fours starting from the right, padding the leftmost group with zeros if it is short, then replace each group with its hex digit. No arithmetic is needed because 16 equals 2 to the fourth, so each 4-bit group maps to exactly one hex character.

What is 1010 in hexadecimal?

1010 in binary is A in hexadecimal. It is already a complete 4-bit group, so no padding is needed, and 1010 is the pattern for decimal 10 — which hex writes as A because it needs a single character for values ten through fifteen.

What is 11111111 in hex?

11111111 is FF, which is 255 in decimal. It splits into two full nibbles, 1111 and 1111, each of which is F. This is the largest value one byte can hold, which is why FF appears constantly in colour codes and byte fields.

What is 101101 in hexadecimal?

101101 in binary is 2D in hexadecimal. Pad it to eight bits as 00101101, split from the right into 0010 and 1101, then convert: 0010 is 2 and 1101 is D. In decimal both are 45.

How many binary digits are in one hex digit?

Exactly four, always. That group of four bits is called a nibble, and two nibbles make a byte — which is why one byte is always written as exactly two hex digits.

What if my binary number isn't a multiple of four bits?

Pad the leftmost group with zeros until it reaches four digits. Leading zeros never change a number's value, so 101101 becomes 00101101 and converts correctly. This applies only before the binary point — after it you pad on the right instead.

How do I convert hexadecimal back to binary?

Replace each hex digit with its four binary digits and keep the order, then drop leading zeros from the whole result. Every digit expands to exactly four bits including small ones, so hex 41 becomes 01000001, not 1000001.

Why is hex used instead of binary?

Because it is far shorter while staying exactly convertible. A 32-bit value takes thirty-two binary characters but only eight hex ones, and because the mapping is four-to-one you can still recover any individual bit without calculation.

What's the difference between a nibble and a byte?

A nibble is four bits and a byte is eight, so a byte is two nibbles. In hex terms, a nibble is one digit and a byte is two — which is the relationship that makes hex convenient for reading raw data.

How do I convert a binary fraction to hex?

Split at the point and handle each side separately. Before the point, group in fours from the right and pad left; after the point, group in fours from the left and pad right. So 0.11 pads to 0.1100 and becomes 0.C.

Is binary to hex the same as binary to base 16?

Yes — hexadecimal is simply the name for base 16. You will also see it shortened to hex, written with a 0x prefix in code, or with a # prefix in CSS and design tools. All refer to the same system.

Mini About Us

We built the Binary to Hexadecimal Converter because every ranking tool returns an answer without showing the grouping that produces it. This one draws the nibbles live as you type, handles binary fractions, and converts in both directions from one page. This site is a part of the ads4good Network.

Read more about Utility Commons here