bx

Binary to HEX

βœ“ Free & no signup πŸ”’ Runs 100% in your browser Updated 2026-11-25 Binary Converter Tools

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 nibbleHex digitDecimal
000000
000111
001022
001133
010044
010155
011066
011177
100088
100199
1010A10
1011B11
1100C12
1101D13
1110E14
1111F15

How to Use This Tool (Step by Step)

  1. Paste your binary into the input box. Spaces between byte groups are accepted and ignored, so 11010110 and 1101 0110 both work.
  2. The hex output appears live with every keystroke; no submit button, no waiting.
  3. Read the result as one hex digit per nibble, two digits per byte, in uppercase.
  4. 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.
  5. 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 inputNibble splitHex output
111111111111 / 1111FF
1010 00011010 / 0001A1
000101100001 / 011016
11010110 100010011101 0110 1000 1001D6 89
101 (3 bits)0101 after left-padding5

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.

Frequently Asked Questions

How do I convert binary to hex by hand?
Split the bits into groups of four starting from the right, pad the leftmost group with zeros if needed, then substitute each group with its hex digit: 0000 is 0, 0001 is 1, 1010 is A, 1111 is F. For 11010110, the groups are 1101 and 0110, which are D and 6, so the answer is D6. No arithmetic is required, only lookup. Keep group boundaries aligned to the right edge because that is where the units position lives, especially for strings longer than one byte.
Why do programmers use hex instead of binary or decimal?
Because hex is compact and bit-aligned at the same time. One hex digit represents exactly four bits, so a byte is two hex digits, a 32-bit word is eight, and there is no ambiguity or arithmetic. Binary needs eight characters per byte, which is error-prone to read and transcribe, while decimal digits do not align with bit boundaries since 10 is not a power of 2. Hex gives you short strings plus a direct mental map to the underlying bits, which is why editors, debuggers, and protocol specs all use it.
What is 11010110 in hex?
D6. Split the byte into two nibbles: 1101 and 0110. The first is 13, which hex writes as D, and the second is 6, written 6. You can verify through decimal: 11010110 is 128 plus 64 plus 16 plus 4 plus 2 equals 214, and hex D6 is 13 times 16 plus 6, also 214. This byte is a popular textbook example because it exercises both the high-letter half and the low-digit half of the nibble table.
How do I handle binary that is not a multiple of 4 bits?
Pad it with leading zeros on the left until the length is a multiple of 4, then convert normally. For the 3-bit string 101, add one zero to get 0101, which is hex 5. Padding on the left is correct because the rightmost bit is the units position and must stay where it is; padding on the right would multiply the value. This tool applies left-padding automatically and tells you when it has done so, so a short input still produces a correct answer.
Is hex output uppercase or lowercase and does it matter?
This tool outputs uppercase letters, so the byte 10101110 prints as AE, matching the convention in most protocol documents, editors, and debugger windows. The case carries no meaning: ae, Ae, and AE are all the value 174. Case only matters in contexts where the string is compared as text, such as URL fragments or case-sensitive configuration files, so keep your own usage consistent within a document. When copying into another tool, check whether it validates one case or accepts both.
Can I convert binary to hex without a converter at all?
Yes, and it is the easiest base conversion to memorize because it is pure substitution. Learn the sixteen nibble patterns once: 8 turns on the top bit of a digit, 4 the next, 2 the next, 1 the last, so 1011 is 8 plus 2 plus 1 equals 11, which is B. Then split any binary string into 4-bit groups from the right and substitute. With a few days of practice you can convert bytes like 11101000 to E8 in your head, which is exactly the skill subnetting and protocol-reading courses expect you to build.

Related Tools