Binary to hex converter

Paste a binary number to get the hex value programmers use for addresses, colors and memory dumps.

Loading the tool…

Processing and privacy: The result is calculated inside your browser and your data is not sent to any server.

How to use it

  1. Enter binary number.
  2. The result appears straight away and updates as you edit.
  3. Copy the result, or copy a link that keeps the same values to share it.

How it is calculated

Split the bits into groups of 4 starting at the point (leftward for the whole part, rightward for the fraction), pad with zeros, then turn each group into one hex digit: 0000 = 0 up to 1111 = F.

Example

Inputs: Binary number = 101011110. Result: Result in hexadecimal: 15E.

101011110
15E

Limits and caveats

  • Negative numbers keep a minus sign in front of the magnitude; they are not shown in two's complement.
  • Up to 2000 digits before the point and 200 after it.

Questions about this tool

Why are bits grouped in fours?

Because 16 = 2 to the power 4, each hex digit stands for exactly four bits, so the conversion needs no division.

What if the bit count is not a multiple of 4?

Zeros are added on the far left of the whole part, so 101011110 becomes 0001 0101 1110 = 15E with the same value.

Is the result upper or lower case?

It is shown in upper case, such as FF. Many programming languages accept the same value written as ff.