Binary to Hex Converter

Convert binary (base 2) numbers to hexadecimal.

Binary
Hex
Runs locally in your browser

About the Binary to Hex Converter

Binary and hex are closely related: each hex digit is exactly four bits, which is why hex is used as a compact way to write binary. This tool converts binary to hex with arbitrary precision, one number per line, ignoring spaces so grouped binary works.

To reverse, use Hex to Binary; for every base at once, the All Base Converter.

Conversion is pure grouping, with no arithmetic needed. Slice the bit string into fours starting from the right-hand end and translate each group on its own, so 1111 0000 1111 0000 becomes F0F0. Starting from the right matters, because the leftmost group is the one that can come up short; when the length is not a multiple of four, that group is padded with zeros on the left, which does not change the value.

That padding is where a bit count quietly goes missing. A 12-bit sensor reading and a 16-bit register both come back as up to four hex digits, so the hex alone will not tell you how wide the field was; keep the width recorded beside the value when it matters. Grouped input is accepted, so bits copied in nibbles or bytes with spaces between them need no cleaning up first. To read the same bits as a plain number, use Binary to Decimal.

How to use

  1. Paste binary numbers, one per line.
  2. Copy the hex results.

Common questions

How many bits per hex digit?
Four. So an 8-bit byte is two hex digits.
Are spaces in the binary handled?
Yes, they are ignored.
Big values?
Handled with arbitrary precision.