Ekuation

conversion

Binary to Hexadecimal Converter

Convert binary to hex using the 4-bit nibble grouping shortcut. Each group of 4 bits equals one hex digit.

Back to Number Base Converter

Enter a binary number (digits 0 and 1). Accepts 0b prefix.

Maximum fractional digits for non-terminating expansions.

Number Base Conversion Tips

Click to show tips

Try an Example

Pick a scenario to see how the calculator works, then adjust the values

ASCII Letter A

Convert the ASCII code for uppercase A (65) across all bases.

Key values: Decimal 65 · Binary 1000001 · Hex 41

Byte Maximum

The largest value a single byte can hold (255).

Key values: Decimal 255 · Binary 11111111 · Hex FF

Hex Color Code

Convert a common hex color code (deep sky blue) to other bases.

Key values: Hex 00BFFF · Decimal 49151 · Binary nibbles

Documentation

The 4-Bit Grouping Trick

Since 16=2416 = 2^4, every group of 4 binary digits maps to exactly one hex digit. This makes conversion a simple lookup:

  1. Pad the binary number with leading zeros so its length is a multiple of 4.
  2. Split into groups of 4 from the right.
  3. Convert each group using the table below.

Example

Convert 110101011 (9 bits):

  • Pad to 12 bits: 000110101011
  • Group: 0001 | 1010 | 1011
  • Look up: 1 | A | B
  • Result: 1AB

Nibble-to-Hex Lookup Table

BinaryHexDecBinaryHexDec
000000100088
000111100199
0010221010A10
0011331011B11
0100441100C12
0101551101D13
0110661110E14
0111771111F15

Hex to Binary (Reverse)

The conversion works in reverse just as easily — expand each hex digit into its 4-bit binary equivalent:

  • 0xFF1111 1111
  • 0x3C0011 1100
  • 0xDEAD1101 1110 1010 1101

Why Use Hex Instead of Binary?

Compactness. A 32-bit value like 11011110101011011011111011101111 is nearly unreadable, but its hex equivalent DEADBEEF is just 8 characters. Since the conversion is trivial (each hex digit = 4 bits), programmers use hex as a human-friendly shorthand for binary data: memory dumps, color codes, MAC addresses, and cryptographic hashes.


Frequently Asked Questions

How do you convert binary to hexadecimal?

Group the binary digits into sets of 4 from right to left, padding with leading zeros if needed. Then convert each 4-bit group to its hex digit using a lookup table. For example, 110101011 becomes 0001 1010 1011, which gives 1AB.

Why does the 4-bit grouping trick work?

Because 16=2416 = 2^4, each hex digit represents exactly 4 binary digits. This perfect power-of-2 relationship means binary-to-hex conversion is a simple digit-by-digit substitution, not a division algorithm.

How do you convert hex back to binary?

Expand each hex digit into its 4-bit binary equivalent. For example, 0xFF becomes 1111 1111, 0x3C becomes 0011 1100, and 0xDEAD becomes 1101 1110 1010 1101.

Why do programmers use hex instead of writing binary directly?

Compactness. A 32-bit binary value like 11011110101011011011111011101111 is nearly unreadable, but its hex equivalent DEADBEEF is just 8 characters. Since conversion is trivial, hex serves as a human-friendly shorthand for binary.

What is the nibble-to-hex lookup table?

The 16 nibble values map as follows: 0000=0, 0001=1, 0010=2, 0011=3, 0100=4, 0101=5, 0110=6, 0111=7, 1000=8, 1001=9, 1010=A, 1011=B, 1100=C, 1101=D, 1110=E, 1111=F.

Related conversion Variants

Explore more conversion options

More Math Calculators

Explore the category

Calculator Search

Search and find calculators