Loading...
Loading...
Enter binary values and get their hex equivalents in real time. Supports single values and multi-line batch input.
Binary code (0s and 1s)
Hexadecimal (base-16)
Hexadecimal (base-16) uses the digits 0 through 9 and the letters A through F, giving 16 distinct symbols. This maps perfectly onto binary because 16 is exactly 2⁴. That means every group of exactly 4 binary digits - called a nibble - corresponds to a single hex digit.
The practical result is that hex is a compact human-readable format for binary data. A 32-bit integer that takes 32 characters to write in binary takes just 8 characters in hex. Engineers working with machine code, network packets, or memory addresses prefer hex because it is dense but still directly mappable to the underlying bits without any arithmetic.
To convert binary to hex manually, split the binary string into groups of 4 bits from the right, padding the leftmost group with leading zeros if needed, then replace each group with its hex digit. The string 10111010 splits into 1011 and 1010, which are B and A, giving 0xBA. The tool above does this grouping automatically for any input length.
CSS color values are a common case. Colors are stored as three 8-bit channels - red, green, and blue - each ranging from 0 to 255 in decimal or 00 to FF in hex. If you are working with a tool that outputs RGB values in binary, converting them to hex gives you the #RRGGBB format browsers use directly.
Assembly language debuggers and disassemblers routinely display memory contents and instruction opcodes in hexadecimal. If your source of truth is a binary bit string from a protocol specification or a hardware datasheet, converting it to hex lets you cross-check it against what the debugger shows.
Binary protocol fields in networking - IP addresses, TCP sequence numbers, DNS record types - are often specified bit-by-bit in RFCs but displayed as hex in real implementations. Converting between the two makes it possible to verify that a captured packet value matches the specification.
Enter one binary number per line or separate multiple values with spaces. You do not need to pad your input to a multiple of 4 bits; the converter pads the leftmost group automatically. A prefix like 0b is not required but is accepted and stripped before conversion.
Output is displayed in uppercase hex without a 0x prefix by default. The result updates live as you type.
Why does a 4-bit group always equal one hex digit?
Because 2⁴ = 16 and hex has exactly 16 symbols (0-9, A-F). The four bit positions represent values 8, 4, 2, and 1. Every combination of those four bits produces a unique number from 0 to 15, which maps one-to-one to a hex digit.
Does the output include a 0x prefix?
No. The output is plain uppercase hex digits without any prefix. If you need the 0x notation for use in source code, add it manually to the front of each result.
Can I paste binary with spaces between bits?
Yes. Spaces within a binary number (such as 1011 0110) are treated as separators between distinct input values, so each space-delimited group is converted independently. If you want a single 8-bit value treated as one number, remove the space before pasting.