Binary is the computer's native language, but eight digits per byte is unreadable for humans. Hexadecimal compresses those same bits into two characters per byte without losing anything, which is why debuggers, protocol documents, and editors all speak hex. This tool performs the compression live: paste binary, get hex, entirely in your browser with no uploads and no signup.
The conversion works on nibbles, the informal name for 4-bit groups. One nibble equals one hex digit, always. The tool groups your bits from the right, so a string whose length is not a multiple of 4 gets left-padded with leading zeros to complete the first nibble rather than truncated, and every error, such as a stray letter in the input, is reported with a clear message instead of silently producing a wrong value.
A worked example anchors the whole idea. Take the byte 11010110. Split it into nibbles from the left here because it is already 8 bits: the first group 1101 is thirteen, which hex writes as D, and the second group 0110 is six, written 6. So 11010110 converts to D6. As decimal that byte is 128 plus 64 plus 16 plus 4 plus 2, which is 214, and D6 is simply 13 times 16 plus 6, which is also 214. Same number, three outfits.
What Is Hexadecimal and How Does It Encode Bits?
Hexadecimal is base 16, using the digits 0 through 9 and the letters A through F for the values ten through fifteen. This tool outputs uppercase letters by convention, so the byte above prints as D6, matching what you will see in most editors, protocol specifications, and debugger windows. Lowercase output is semantically identical; case is presentation, not value.
The reason hex fits binary so neatly is arithmetic: sixteen is 2 to the 4th power, so a single hex digit carries exactly as much information as four bits. Two digits carry one byte, four digits carry 16 bits, and eight digits carry a 32-bit word. Every other common base misaligns: decimal 10 is not a power of 2, so decimal digits straddle bit boundaries and conversions require real computation, while hex never does.
The sixteen nibble patterns, which you can treat as a lookup table, produce these values:
| Binary nibble | Hex digit | Decimal |
|---|---|---|
| 0000 | 0 | 0 |
| 0001 | 1 | 1 |
| 0010 | 2 | 2 |
| 0011 | 3 | 3 |
| 0100 | 4 | 4 |
| 0101 | 5 | 5 |
| 0110 | 6 | 6 |
| 0111 | 7 | 7 |
| 1000 | 8 | 8 |
| 1001 | 9 | 9 |
| 1010 | A | 10 |
| 1011 | B | 11 |
| 1100 | C | 12 |
| 1101 | D | 13 |
| 1110 | E | 14 |
| 1111 | F | 15 |
How to Use This Tool (Step by Step)
- Paste your binary into the input box. Spaces between byte groups are accepted and ignored, so 11010110 and 1101 0110 both work.
- The hex output appears live with every keystroke; no submit button, no waiting.
- Read the result as one hex digit per nibble, two digits per byte, in uppercase.
- If the input is not a multiple of 4 bits, the tool pads on the left so the first nibble completes; the message area warns you when padding was applied.
- Use the copy button to grab the result, or paste the hex into the paired hex-to-binary tool to verify the round trip.
Worked Examples
| Binary input | Nibble split | Hex output |
|---|---|---|
| 11111111 | 1111 / 1111 | FF |
| 1010 0001 | 1010 / 0001 | A1 |
| 00010110 | 0001 / 0110 | 16 |
| 11010110 10001001 | 1101 0110 1000 1001 | D6 89 |
| 101 (3 bits) | 0101 after left-padding | 5 |
The last row shows the padding rule in action: a 3-bit input cannot fill a nibble, so the tool treats it as 0101 and returns 5 rather than guessing a different value.
How the Conversion Works Internally
The pipeline is deterministic and short. Step one: the input is stripped of spaces and validated so every character is 0 or 1; anything else raises a named error. Step two: the bit string is left-padded with zeros to the next multiple of 4, so grouping starts on a clean boundary. Step three: each 4-bit group is looked up in the table above and replaced by its hex digit, and digits are joined in order, one space between bytes for readability.
No multiplication or addition happens at any step, which is exactly why the conversion is lossless. The hex output carries precisely the bits you gave it. Converting back with the reverse tool reproduces the input bit for bit, padding included, which is the property that makes hex the standard interchange format for raw memory.
Common Use Cases
- Networking and subnetting: IPv4 addresses, netmasks, and interface flags are easier to compare in hex; converting a binary netmask like 11111111 11111111 11111000 00000000 to FF FF F8 00 makes its structure visible at a glance.
- Protocol documentation: packet formats specify fields in hex; translating captured bits into hex lets you match your data against the spec line by line.
- Permission and flag masks: file permission bits or hardware register flags compress into short hex codes, which is how Unix permission masks and bitmask constants are traditionally written.
- Exam and homework checking: number-system worksheets love 8-bit and 16-bit strings; a quick conversion verifies your nibble arithmetic.
- Reading memory dumps backward: when you know what the bits mean and need the editor-style hex notation to search a dump for the same bytes.
Why Grouping from the Right Matters
When a bit string is longer than one byte, the nibble boundaries are defined from the right end. Take the 10-bit string 1110010110. Grouping from the right gives 10 / 1110 / 0110, so the leftmost group is incomplete and receives two leading zeros: 0010 / 1110 / 0110, which is 2E6. Grouping from the left instead would produce entirely different digits, 1110 / 0101 / 10-something, and a wrong value. The right edge is where the units digit lives, in every base, so alignment must start there. The tool handles this automatically, but knowing the rule means you can spot a transcribed value whose grouping was mangled by hand.
Tips and Best Practices
- Pad consciously: if your source data has a known width, such as 8 or 16 bits, ensure the input carries its leading zeros so no automatic padding is needed.
- Round-trip test long strings: paste the hex output into hex-to-binary and compare against your original bits; a mismatch means a transcription error somewhere upstream.
- Watch for confusable characters: hex output includes letters that look like digits in some fonts; copying rather than retyping eliminates the classic B-versus-8 mistake.
- Chunk very long streams: for thousands of bytes, process in blocks and label each block, because a single missed bit early on shifts every subsequent nibble.
- Remember case conventions: this tool prints uppercase, matching most technical documentation, but some tools expect lowercase; the value is identical either way.
Binary-to-Hex Compared with Binary-to-Decimal
Both conversions compress binary for human consumption, but they feel completely different to perform. Hex requires only substitution: look at 1101, answer D, no arithmetic. Decimal requires positional sums: 1101 is 8 plus 4 plus 1 equals 13. That difference is why network engineers, debugger users, and protocol authors default to hex even though decimal numbers look more familiar. If you need the decimal value itself, the site's binary-to-decimal tool walks through the powers-of-2 method with the same input handling: spaces tolerated, clear errors, live output, all computed locally on your device.