Free Binary to Hex Converter

Paste binary, press Convert to Hex and get exact hexadecimal digits for one number or a whole list, or upload a TXT file.

Words Limit/Search : 100
Upto 1,000 Words Sign up free

Upload File

What Is a Binary to Hex Converter?

Quick answer: A binary to hex converter rewrites base 2 numbers (0s and 1s) as hexadecimal, base 16, written with the digits 0 to 9 and a to f. Paste one number or a list, press Convert to Hex, and each group comes back as hex. Try it with your own binary.

Every four bits (one nibble) make exactly one hexadecimal digit, so base 2 to base 16 needs no arithmetic. That is why a memory address, MAC address, color code or checksum is usually written in hex in debugging and networking: it is the same bits at a quarter of the length. The tool takes unsigned bits and returns a lowercase hex string.

How to Use the Binary to Hex Converter

  1. Add your bits. Paste into the box labeled Enter or paste your Binary, with a space or line break between numbers. Or press Upload File and pick a .txt file.
  2. Press Convert to Hex. A Result card appears.
  3. Copy the result. Use Copy to Clipboard or Save as TXT.

A space or line break always starts a new number, so write 11110000 for f0; 1111 0000 gives f 0. Guests can convert up to 100 numbers per run and a free account up to 1,000.

Binary to Hex Examples

Each row was checked against Python. Paste a row and compare.

BinaryGrouped in foursHex
010000010100 000141
111111111111 1111ff
000010100000 10100a
101100001 011016
10100111010010 1001 110129d
11110000101001011111 0000 1010 0101f0a5
11000000 10101000 00000001 00000001four separate bytesc0 a8 01 01

In row four, 16 is hex, not decimal. The last row is the IPv4 address 192.168.1.1 as four bytes; leading zeros survive. A color channel in an RGB to hex value is also one byte.

How to Convert Binary to Hex by Hand

Group bits in fours, right to left (a four-bit group is a nibble), pad with leading zeros if the leftmost group is short, then replace each group with its digit. The nibbles 0000 to 1001 are the digits 0 to 9. After that the letters take over: 1010 is a, 1011 is b, 1100 is c, 1101 is d, 1110 is e and 1111 is f.

Try 1010011101. The groups are 1101, 1001 and a short 10 that pads to 0010, which reads 2, 9, d, so the answer is 29d. Group 10110 from the left and it becomes 1011 0, which reads b0 instead of the correct 16.

The shortcut works because 16 is 2 to the 4th power, so place value runs in powers of two. To check a result in code, run format(int(bits, 2), 'x') with Python's int() function, or paste it into the converter.

What the Converter Does and Does Not Do

Each nibble is looked up in a 16-entry table, so no number is ever parsed as a float and a 16-, 32- or 64-bit pattern stays exact. In our tests, 64 ones returned ffffffffffffffff and a 200,000 digit group returned 50,000 hex digits in under a second in our tests. An 8-bit group always gives two digits, so 00001010 is 0a.

Negative numbers, fractions and a binary point are rejected. The output is always lowercase with no 0x prefix, and the page shows no working steps. In JavaScript, toString loses precision past 53 bits.

Fix the 'Input is not valid Binary' Message

One bad character in any group stops the whole run. Nothing is half converted.

  • Stray characters. A 2 as in 1012, a trailing b, a sign or a pasted hex letter all trigger it.
  • Prefixes and separators. Remove 0b and turn separators such as commas into spaces.

Limits and Files

Upload File takes one .txt file, and a PDF is refused. Typed text wins over a file, so clear the box first. One request holds up to 200,000 characters.

Related Number Converters

Last updated

Frequently Asked Questions

Frequently Asked Questions (FAQs) is a list of common questions and answers provided to quickly address common concerns or inquiries.

How do you convert binary to hex?

Split the bits into groups of four from the right, pad the leftmost group with zeros, then replace each group with one hex digit. For example, 1010011101 becomes 0010 1001 1101, which is 29d. The tool does the same for a whole list of numbers.

What is 11111111 in hex?

11111111 is ff. Each group of four ones is 1111, which maps to f, and two of them fill one byte. In decimal that is 255, the largest value an unsigned byte can hold. Our converter returns it in lowercase, with no 0x prefix.

Why does my result have a leading zero, like 0a?

Every four bits become one digit, so eight bits always give two: 00001010 is 0a, and 000000 pads to 00000000, which is 00. That matters for bytes, IPv4 octets and color channels. If you want a plain a, enter 1010 instead of the full byte.

Why did 1111 0000 give f 0 instead of f0?

A space separates numbers, so 1111 and 0000 are converted as two values, f and 0. Remove the space and enter 11110000 to get f0. Use spaces only between whole values, such as one byte after another.

Can it convert binary with a decimal point or negative numbers?

No. The converter reads unsigned whole binary only. A binary point, a minus sign or a prefix such as 0b returns Input is not valid Binary, and nothing is half converted. Signed values are not handled.

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

In Python, format(int(bits, 2), 'x') works, so 1010011101 gives 29d. In JavaScript, parseInt(bits, 2).toString(16) is safe only up to 53 bits, so use BigInt for longer values. Our tool stays exact to 200,000 characters.
Share on Social Media: