Beginner

Binary to Hexadecimal Converter

Enter a binary number (any length) and instantly see the hexadecimal equivalent, plus decimal, octal and the binary grouped into 4-bit nibbles — the notation used in hardware, networking and machine code.
Digits 0 and 1 only — spaces are ignored
Hexadecimal result
0x2A
Hexadecimal
0x2A
Decimal
42
Octal
0o52
Binary (nibble groups)
0010 1010
Significant bits
6
Bytes required
1
0326496128160192224256Decimal value on the binary number line
Results are estimates for general information only and are not professional advice — always verify important results independently before relying on them. Read the full disclaimer.
Quick answer

How does this calculator work?

Group your binary string into 4-bit nibbles (zero-pad the left if needed), then swap each nibble for the matching hex digit: 0000→0, 0001→1, …, 1010→A, …, 1111→F. One nibble equals one hex digit. Enter any binary number and the conversion appears instantly alongside decimal and octal equivalents.

Formula
Pad to a multiple of 4 bits → split into nibbles → map each nibble to one hex digit (0000→0, …, 1111→F)
How this is calculated

Hexadecimal (base 16) uses digits 0–9 and letters A–F to represent values 0–15. The elegant shortcut between binary and hex comes from the fact that 2⁴ = 16, meaning exactly four binary bits (one nibble) map to exactly one hex digit. To convert: left-pad the binary string to the nearest multiple of 4 bits with zeros, then replace each 4-bit group with its hex equivalent — 0000 → 0, 0001 → 1, 0010 → 2, …, 1010 → A, 1011 → B, 1100 → C, 1101 → D, 1110 → E, 1111 → F. The reverse is equally trivial: expand each hex digit back to four bits.

For example, binary 10101111 becomes the two nibbles 1010 and 1111, which map to A and F, giving hexadecimal 0xAF (decimal 175). This 1-to-4 relationship is why hex is universally used as a compact human-readable form of binary data: IPv6 addresses, colour codes, memory addresses, machine opcodes and cryptographic hashes are all written in hex.

This calculator uses JavaScript BigInt arithmetic, so it handles arbitrarily long binary strings without any floating-point rounding — useful for cryptographic keys and 64-bit register values that exceed the safe integer range of ordinary numbers.

Frequently asked questions

Hexadecimal is four times more compact than binary: a 32-bit value needs 8 hex digits instead of 32 binary digits. Because each hex digit maps one-to-one to a 4-bit nibble, you can still mentally convert back to binary, giving you compactness without losing the bit-level clarity that decimal does not provide.

A nibble is exactly 4 binary bits — half an 8-bit byte. It can hold values 0 through 15, which corresponds to exactly one hex digit. The word "nibble" is a playful engineering pun: if a byte is a full bite, a nibble is half.

Reverse the process: expand each hex digit to four binary bits. For example, A = 1010 and F = 1111, so 0xAF = 10101111 in binary. This makes round-tripping between hex and binary entirely mechanical.

APA

TG we-Calculate Editorial Team. (2026). Binary to Hexadecimal Converter [Online calculator]. TG we-Calculate. https://we-calculate.com/calculator/binary-to-hexadecimal-calculator

Chicago

TG we-Calculate Editorial Team. "Binary to Hexadecimal Converter." TG we-Calculate. 2026. https://we-calculate.com/calculator/binary-to-hexadecimal-calculator.

IEEE

TG we-Calculate Editorial Team, "Binary to Hexadecimal Converter," TG we-Calculate, 2026. [Online]. Available: https://we-calculate.com/calculator/binary-to-hexadecimal-calculator

BibTeX

@misc{wecalculate_binary_to_hexadecimal_calculator, title = {Binary to Hexadecimal Converter}, author = {{TG we-Calculate Editorial Team}}, howpublished = {\url{https://we-calculate.com/calculator/binary-to-hexadecimal-calculator}}, year = {2026}, note = {TG we-Calculate} }

Did this calculator help you?