Tools
EN

Binary to Hexadecimal Converter

Paste a binary number and get its hex value instantly. Spaces, underscores and the 0b prefix are ignored, so values copied from code or datasheets work as they are.

Tip: enter one number per line to convert a whole list.

In all bases

Hexadecimal
Decimal
Binary
Octal

Private: your data is processed in your browser and never uploaded.

How to convert binary to hex

  1. Paste or type a binary number such as 1101 0110 or 0b11010110. Put several numbers on separate lines to convert them all at once.
  2. The hex value appears as you type, together with decimal and octal. The steps below the result show how the bits are grouped.
  3. Copy the hex result, or press Swap to convert hex back to binary.

How to convert binary to hexadecimal

  1. Split the binary number into groups of 4 bits, starting from the right (for fractions, start at the binary point and work outwards).
  2. Pad the leftmost group with zeros if it has fewer than 4 bits.
  3. Replace every group with its hex digit from the table below.

Example: 1011111001 → 0010 1111 1001 → 2, F, 9 → 2F9. Bytes are even quicker: 1100 0011 = C3.

Binary to hex table

BinaryHexBinaryHex
0000010008
0001110019
001021010A
001131011B
010041100C
010151101D
011061110E
011171111F

Why programmers write binary as hex

Long binary numbers are hard to read and easy to mistype. Because one hex digit stands for exactly four bits, hex is four times shorter but still shows the bit pattern directly: the 32-bit value 1101 1110 1010 1101 1011 1110 1110 1111 is simply DEADBEEF. That is why memory addresses, colour codes, MAC addresses, file signatures and machine code are written in hex.

Frequently asked questions

What if the number of bits is not a multiple of 4?

Add zeros on the left until it is. 101 becomes 0101 = 5 and 11010 becomes 0001 1010 = 1A. Leading zeros never change the value.

What is 11111111 in hex?

11111111 is FF in hex: the two groups 1111 and 1111 are both F. In decimal it is 255.

How do I convert binary to hex in Python, JavaScript or Excel?

Python: format(int('11010110', 2), 'X') returns D6. JavaScript: parseInt('11010110', 2).toString(16) returns d6. Excel: =BIN2HEX("11010110"), but Excel accepts at most 10 bits.

Can I convert binary fractions to hex?

Yes. Group the bits after the point from left to right and pad the last group with zeros on the right: 0.1011 = 0.B and 110.01 = 6.4 in hex.