Convert binary integers to compact hexadecimal notation, with a reverse hex-to-binary mode for checking the same value.
Last updated: August 2026 | By Workshelve Team
Binary is base 2, so each digit is either 0 or 1. Hexadecimal is base 16 and uses the symbols 0-9 and A-F. The key relationship is that one hexadecimal digit represents exactly four bits, so a binary integer can be converted by working from right to left in four-bit groups.
If the first group contains fewer than four bits, leading zeros can be added to complete that group without changing the numeric value. For example, 101101 becomes 0010 1101 for grouping purposes, which maps to 2D in hexadecimal.
Hex is useful when a binary value is too long to scan comfortably but you still want its bit structure to remain visible. Common examples include byte values, masks, file or protocol fields, hashes displayed as hex, and hexadecimal values used in source code. CSS also defines hexadecimal notation for sRGB colors, although CSS supports several other color syntaxes too.
8 bits become two hex digits
The leftmost group is padded to four bits
Repeated 1010 groups map to A
Eight 1 bits map to two F digits
Hexadecimal has 16 symbols and four binary bits have 16 possible patterns. That gives every 4-bit group a one-to-one hexadecimal digit from 0 through F.
The converter pads only the leftmost group with leading zeros before mapping the groups to hex. For example, 10101 is treated as 0001 0101 and becomes 15.
Not for this calculator. It treats the input as an unsigned numeric representation, so leading zeros are not kept in the final result: 00001111 becomes F.
No. This page intentionally accepts a plain binary digit string containing only 0 and 1. Remove separators or programming-language prefixes before converting.
Yes. Conversion is performed one four-bit group at a time rather than converting the entire input to a JavaScript Number, so long integer strings do not lose precision during the radix conversion.
No. This tool converts a numeric bit string directly between base 2 and base 16. Turning text into hex first requires a character encoding such as UTF-8 to produce bytes.
A single hex digit corresponds to exactly four bits, so bit boundaries remain easy to see while full four-bit groups use one hex digit instead of four binary digits. For values whose leftmost group is shorter than four bits, the overall character-count reduction is approximate rather than exactly four-to-one.
Choose Hex → Binary. The reverse mode expands each hex digit to four bits, then removes leading zeros so the result represents the same unsigned numeric value.
Related Tools
Convert HEX color codes into RGB color values.
Convert number base values.
Convert Base64 encoded data into hexadecimal values.
Convert hexadecimal values into Base64 encoded data.
Convert hexadecimal values into binary numbers.
Convert CMYK color values into HEX color codes.