User Rating 0.0
Total Usage 0 times
Accepts 0s and 1s. Spaces, tabs, and newlines are ignored.
Is this tool helpful?

Your feedback helps us improve.

About

Binary (base-2) is the native language of digital hardware. Hexadecimal (base-16) compresses every 4 binary digits into a single hex digit, reducing transcription errors by a factor of four. Manual conversion is error-prone: a single misread bit in a 32-bit address flips the hex result entirely, which can corrupt memory maps, MAC addresses, or color codes. This tool validates input, pads to the nearest nibble boundary, and maps each 4-bit group to its hex equivalent. It assumes unsigned, big-endian bit ordering. For signed integers or IEEE 754 floats, interpret the raw hex output according to the relevant standard.

binary to hex binary converter hexadecimal converter number system converter base 2 to base 16 binary translation

Formulas

Each group of 4 binary digits (a nibble) maps to exactly one hexadecimal digit. The binary string is first left-padded with zeros so its length is a multiple of 4.

H = map(b3b2b1b0) = b3 × 8 + b2 × 4 + b1 × 2 + b0 × 1

Where H is the resulting hex digit (0 - F), and b3 through b0 are individual bit values (0 or 1). The full hex output is the concatenation of all nibble mappings from most-significant to least-significant.

Reference Data

Binary NibbleDecimalHex
000000
000111
001022
001133
010044
010155
011066
011177
100088
100199
101010A
101111B
110012C
110113D
111014E
111115F

Frequently Asked Questions

Hexadecimal digits map one-to-one with 4-bit groups (nibbles). If your binary string length is not a multiple of 4, leading zeros are added to complete the most-significant nibble. This does not change the numeric value - for example, 110 becomes 0110, which correctly maps to hex 6.
This tool performs unsigned conversion. For two's complement interpretation, check if the most-significant bit is 1 (negative). If so, the hex output represents the raw bit pattern. To find the magnitude, invert all bits and add 1, then convert. For example, 11111100 converts to hex FC. Inverting gives 00000011, adding 1 gives 00000100 = decimal 4, so the signed value is −4.
Yes. The converter strips all whitespace and newlines before processing. You can enter "0100 1000 0110 0101" or "01001000 01100101" - both produce the same hex output "4865". This makes it easy to paste binary dumps from debuggers or datasheets.
The converter accepts up to 10,000 binary characters (excluding whitespace). This corresponds to 2,500 hex digits or 1,250 bytes - sufficient for most register dumps, MAC addresses, IPv6 addresses, and small binary payloads. JavaScript handles this entirely in-memory with no performance concern.
Hexadecimal groups bits in fours; octal groups in threes. Both are power-of-2 bases, making conversion from binary a direct mapping without arithmetic division. For octal, you would pad to a multiple of 3 instead of 4. This tool specifically targets base-16 output because hex is the dominant notation in programming, networking, and hardware documentation.
The "0x" prefix is a notation convention used in C, JavaScript, and Python to denote hexadecimal literals. This tool optionally prepends "0x" to the output for convenience. It is not part of the numeric value itself. When pasting hex output into code, ensure your language expects the prefix.