Skip to content

Binary to Hex Converter

Turn bit patterns into hexadecimal digit by digit, keeping every leading zero so the width of the value is preserved.

Processed locally in your browser

Options
One number per line. Spaces and underscores inside a number are ignored.0 chars · 0 lines
The result will appear here.

What is Binary to Hex Converter?

Every four binary digits (a nibble) map to exactly one hexadecimal digit: 1111 is F, 1010 is A, 0001 is 1. That is why hex is the compact way to write bit patterns. This tool pads the input to a multiple of four bits and converts each nibble, without any size limit.

Unlike a numeric conversion, it can keep leading zeros, so 00000001 becomes 01 and not 1. You can group the hex output by bytes, add a 0x prefix, choose uppercase and pad to 1, 2, 4 or 8 bytes. Spaces, underscores and a 0b prefix in the input are ignored.

How does it work?

  1. Paste one binary value per line, for example 1111 0000 1010 0101.
  2. Keep “Keep leading zeros” on to preserve the bit width, or turn it off for the shortest hex value.
  3. Choose byte grouping, the 0x prefix, uppercase and padding.
  4. Copy the hex output; a single value also shows the decimal number and bit length.

Common use cases

  • Writing a bit mask or register value in the hex form used in datasheets.
  • Compacting long bit strings into hex for logs and documentation.
  • Checking hand conversions in digital-logic or embedded-systems exercises.
  • Converting binary protocol fields into hex bytes.

Examples

Try this input in the tool above:

Input
11110000 10100101
0b1010
00000001
Output
F0A5
A
01

Privacy

Binary to Hex Converter runs entirely in your browser. The text or files you provide are processed on your device and are not uploaded, logged or stored on our servers.

Limitations

Input must contain only 0 and 1 (plus ignored separators). If the number of bits is not a multiple of four, the pattern is left-padded with zeros. Negative sign is kept as a plain minus in front, not as two’s complement.

Frequently asked questions

How do I convert binary to hex by hand?

Split the bits into groups of four from the right and replace each group with its hex digit: 1111 0000 becomes F0.

Why keep leading zeros?

They carry the width of the value: 0000 0001 is one full byte, 01 in hex. Dropping them gives 1, which loses that information.

Is there a length limit?

No practical limit. Bit strings with thousands of digits convert instantly.

More tools in Developer Tools →