Binary to hexadecimal

Convert binary to hexadecimal as you type, with any number of digits, the method step by step and a reference table.

loading Binary to hexadecimal
About this tool

Binary and hexadecimal

Binary (base 2) is how hardware stores every number: each digit is a bit, worth a power of 2. Hexadecimal (base 16) writes each group of 4 bits as one digit from 0 to F, so one byte is always two hex digits; it is the language of memory addresses, colors and hashes.

Hex is the compact way to write binary: every 4 bits become one digit, so long bit strings from protocols and datasheets become readable.

This page opens the base converter with binary as the input; it shows binary, octal, decimal, hexadecimal and Base64 at once, accepts prefixes such as 0x, 0b and 0o, and works with numbers of any length (no 2^53 limit). It runs in your browser.

Binary vs hexadecimal

Binaryhexadecimal
Base216
Digits0 10–9 A–F
Prefix in code0b0x
255 is written11111111FF

How to convert binary to hexadecimal by hand

No arithmetic needed: each 4 bits are one hexadecimal digit. Group the bits from the right (pad with zeros on the left) and translate each group:

Bits1011001100101101
DigitB32D

So 1011001100101101 = B32D (decimal 45869).

Binary to hexadecimal table

Values computed by the converter itself:

BinaryHexadecimal
00
11
102
1117
10008
1010A
1111F
1000010
10000020
100000040
110010064
11111117F
11111111FF
100000000100
11111010003E8
10000000000400
10000000000001000
1111111111111111FFFF

Binary to hexadecimal in code

JavaScript

(parseInt('10011100', 2)).toString(16); // '9c'

Python

format(int("10011100", 2), "X")  # '9C'

For integers beyond 2^53 in JavaScript, use BigInt: BigInt("0x…").toString(16).

Frequently asked questions

Does it handle very large numbers?

Yes. The converter uses arbitrary-precision integers (BigInt), so a 256-bit hash or a 100-digit number converts exactly; JavaScript Number would lose digits above 2^53.

Can I convert negative numbers or fractions?

Negative integers keep their sign (-255 → -FF); the tool does not write two’s complement or fractional digits. For a two’s complement byte, add 256 first (−1 → 255 → FF).

Why do programmers use hexadecimal instead of binary?

Because it is binary in short form: 4 bits per digit, 2 digits per byte, so 0xFF is easier to read than 11111111 and still maps bit for bit.

Report a problem