Binary to Hex

Encoders & Decoders

How to use the Binary to Hex

Convert binary to hex in two steps:

1

Enter the binary number

Type or paste any binary number using 0 and 1 digits. Spaces, underscores, and nibble groupings are automatically stripped.

2

Read the hex result

The hex output appears with the 0x prefix and byte grouping display. Decimal equivalent is shown in the panel below.


When to use this tool

Use to convert between binary and hexadecimal for programming and protocol work:

  • Converting binary register contents or bit patterns to hex for more compact notation in documentation or code comments
  • Translating binary output from logic analyzers or JTAG debuggers to hex for easier comparison with datasheets
  • Converting binary MAC addresses or IPv6 addresses to their hexadecimal representation
  • Transforming binary values from bitfield calculations to hex for embedding in C preprocessor macros or assembly constants
  • Verifying that nibble boundaries in a binary value correspond to the expected hex digits
  • Converting binary pixel data or binary-encoded color values to hex for display in UI components

Frequently asked questions

Q:Why is binary to hex conversion so natural?
Each hexadecimal digit maps exactly to 4 binary bits (a nibble). The mapping is: 0=0000, 1=0001, 2=0010, 3=0011, 4=0100, 5=0101, 6=0110, 7=0111, 8=1000, 9=1001, A=1010, B=1011, C=1100, D=1101, E=1110, F=1111. This perfect 4-to-1 correspondence means you can convert by reading each group of 4 binary bits as a single hex digit directly, without any arithmetic. Binary 1010 1010 = AA hex because 1010=A and 1010=A.
Q:How do I convert binary to hex manually?
Group the binary number into nibbles (groups of 4 bits) from right to left, padding the leftmost group with leading zeros if needed. Then convert each nibble to its hex equivalent using the table: 0000=0, 0001=1, …, 1001=9, 1010=A, 1011=B, 1100=C, 1101=D, 1110=E, 1111=F. Example: 11111110 → 1111 1110 → F E → 0xFE. This is faster and more error-prone-free than going through decimal.
Q:Can I convert binary with nibble spaces directly?
Yes — binary values grouped with spaces (e.g. '1111 0000 1010 0101') or underscores (e.g. '1111_0000_1010_0101') are accepted directly. The tool strips the grouping separators before conversion, so you can paste from datasheets, logic analyzer output, or documentation without editing. The tool also displays the binary grouped back in nibbles in the output panel for easy reading.
Q:What is binary 11111111 in hex?
Binary 11111111 = hex 0xFF = decimal 255. This is the most important 8-bit value: all 8 bits set, representing the maximum unsigned byte value. In hex, two hex digits (FF) compactly represent what takes 8 binary digits. This 4:1 compression ratio is why hex is the preferred notation for binary data in programming — a 32-bit value that takes 32 binary digits needs only 8 hex digits.
Q:How is binary-to-hex useful in network and protocol work?
Network protocols often define fields at the bit level in binary but are documented and transmitted in hex. MAC addresses (48-bit) are shown as 6 hex bytes (AA:BB:CC:DD:EE:FF). IPv6 addresses are 128-bit shown as 8 groups of 4 hex digits. TLS/SSL handshake bytes, TCP flag bits, and DNS flag fields are all best understood by converting the binary representation to hex, which maps directly to the protocol byte structure.
Q:Does the tool handle binary strings longer than 64 bits?
Yes — the tool uses JavaScript BigInt for the internal conversion, which handles binary strings of any length without precision loss. 32-bit, 64-bit, 128-bit, and longer binary values all convert correctly. The hex output and byte grouping scale accordingly. Standard JavaScript numbers (64-bit float) would lose precision beyond 2⁵³ (53 bits), but BigInt avoids this entirely, making the conversion exact regardless of the input length.