Home / Encoding tools / Binary to hex

Binary to Hex Converter

Enter a binary number and get its hexadecimal value, with each group of four bits shown next to its hex digit.

Grouping

Convert a list

Quick reference

The shortcut: groups of four bits

Hexadecimal, or hex, is base 16. Because 16 is 2 to the power 4, every hex digit stands for exactly four binary digits. That means you can convert without any arithmetic: split the bits into groups of four, starting from the right, and replace each group with its hex digit.

11010110
1101 0110
 D    6     =  D6

If the number of bits is not a multiple of four, add zeros on the left. For example, 101 becomes 0101, which is 5.

Hex digits

Hex uses the digits 0 to 9 and then the letters A to F for the values 10 to 15. So 1010 is A, 1111 is F, and 1100 is C. The table at the bottom lists all sixteen.

Another example

The 16 bits 1011 1100 1111 0000 give the hex number BCF0.

Why hex is used

  • Colors in web design, such as #FF8800.
  • Memory addresses and machine code.
  • Network addresses, such as the six pairs in a MAC address.
  • Dumps of file bytes, where one byte is two hex digits.

Options

Choose upper or lower case letters, and add the 0x prefix that most programming languages use. Spaces and underscores in your binary number are ignored, so you can paste grouped bits. Paste a list to convert many numbers at once.

To go the other way, use hex to binary. For decimal, try binary to decimal. New to the idea? Read the guide to binary numbers.

Frequently asked questions

How do I convert binary to hex?

Group the bits in fours from the right, padding with zeros on the left, and replace each group with its hex digit.

What is 1111 in hex?

F. Four ones make 15, which is F in hexadecimal.

What is 11010110 in hex?

D6. The groups are 1101 and 0110, which are D and 6.

Why use hex instead of binary?

It is much shorter and easier to read, and it converts to binary one digit at a time.