Binary to Hex Converter Online

Convert any binary string to hexadecimal with nibble grouping. Batch mode for hundreds of values, all four bases shown side-by-side — 100% in your browser.

Enter a binary string to see its hex grouping and all four base representations.

What is binary to hex conversion?

Binary to hex conversion rewrites a base-2 string as a base-16 string. Because 16 = 24, every group of four binary bits maps to exactly one hex digit. Group the bits into nibbles from the right, look up each nibble in the 16-entry table, and you have the hex result — no division, no remainders.

The OpenFormatter binary-to-hex converter runs in your browser — no upload, no rate limit, no account. It pads the leftmost nibble if needed, groups the bits, renders the hex, and shows the equivalent decimal and octal alongside.

How to convert binary to hex — 4 steps

  1. Enter the binary string. Optional 0b prefix. Anything other than 0 and 1 raises an error; whitespace is stripped automatically.
  2. Read the hex output. The result is grouped into nibbles internally and rendered as compact uppercase hex.
  3. Study the nibble grouping. Each 4-bit group is shown alongside the hex digit it produces — perfect for learning the mapping.
  4. Switch to batch mode. Convert many bit strings at once and copy the table to a spreadsheet.

Sample input and output

Input:  11111111

Output:
  Binary:  11111111
  Hex:     0xFF
  Decimal: 255
  Octal:   0o377

Nibble grouping: 11111111₂ = 1111 (F) | 1111 (F) = 0xFF

Eight bits is two nibbles, which is exactly two hex digits — one byte. That clean alignment is why hex is the default shorthand whenever bytes are involved.

Single + Batch Modes

Encode a single bit pattern with full nibble grouping, or paste hundreds of bit strings (one per line) for a copyable conversion table.

Educational Grouping

Each 4-bit group shown alongside the hex digit it produces — the fastest way to internalize the 16-entry nibble lookup table.

Client-Side Only

All math runs in the browser — no upload, no telemetry. Verify in DevTools Network and use safely with internal data.

Common use cases

  • check_circleCompacting long bit dumps from logic analyzers and protocol traces
  • check_circleTranslating raw register state from a firmware printf into a copyable hex value
  • check_circleBuilding 24-bit CSS color codes from per-channel binary calculations
  • check_circleEncoding flag bits for IPC, packet headers, and serialization formats
  • check_circleReverse engineering — converting captured bit patterns back into hex literals for the disassembler
  • check_circleHardware design — turning ROM/FPGA bit patterns into hex initialization files
  • check_circleCryptography labs — visualizing bit-level XOR or S-box outputs as hex digests
  • check_circleJob interviews and whiteboards — fast nibble-grouping reasoning between bases

Nibble / hex lookup table

BinaryHexDecimalBinaryHexDecimal
000000100088
000111100199
0010221010A10
0011331011B11
0100441100C12
0101551101D13
0110661110E14
0111771111F15

Memorise this 16-entry table and you can convert any binary string to hex by inspection — no calculator, no parseInt.

The conversion math, explained

Internally, the tool pads the binary string to a multiple of 4 bits on the left, then slices it into 4-bit groups and converts each group with parseInt(nibble, 2).toString(16). For 1100101011111110: split into 1100 1010 1111 1110, look up each group → C, A, F, E → CAFE. Equivalently, you can read the bits four at a time from the right and write the hex digits in the same order. The tool also calls parseInt(bin, 2).toString(16).toUpperCase().padStart(Math.ceil(bin.length/4), '0') for the all-four-bases panel when the value fits in a JavaScript safe integer (53 bits).

Need the reverse direction?

Browse the rest of the OpenFormatter base toolkit — every conversion runs in your browser.

Frequently Asked Questions

How does binary to hex conversion work?

Group the bits into nibbles (4-bit groups) starting from the right, then map each nibble to one hex digit. 0000 = 0, 0001 = 1, … 1001 = 9, 1010 = A, 1011 = B, 1100 = C, 1101 = D, 1110 = E, 1111 = F. So 11111111 splits into 1111 1111 = FF, and 1100101011111110 splits into 1100 1010 1111 1110 = CAFE.

Why group bits from the right?

Positional notation gives the rightmost bit the lowest place value. Grouping from the right ensures each nibble corresponds to the correct power-of-16 position. If the bit count is not a multiple of 4, the leftmost group is padded with zeros — which does not change the value, only the visual width.

What if my binary length is not a multiple of 4?

The tool pads the leftmost nibble with zeros so the grouping aligns from the right. For example, 10101 becomes 0001 0101 = 15. This is mathematically identical to the original — leading zeros never change a number's value.

Does the input accept a 0b prefix?

Yes. The converter accepts 0b11111111 or just 11111111 — both produce FF. Whitespace is also stripped. Anything other than 0, 1, or the 0b prefix triggers an error.

Why is hex such a good shorthand for binary?

Because 16 = 2^4, every hex digit packs exactly four binary bits. That perfect alignment means a 32-bit register fits in 8 hex digits, a byte in 2 hex digits, and so on — no padding tricks. Hex is dense, byte-aligned, and trivially convertible by hand once you know the 16-entry nibble table.

Is there a length limit on the binary input?

For binary-to-hex conversion itself, no — the tool processes any length nibble by nibble. The decimal and octal columns are only filled in for inputs of 53 bits or fewer (the JavaScript safe-integer range). Longer values still convert to hex correctly; the decimal column simply shows a dash.

How is the hex case set on output?

Output uses uppercase hex by default to match the dominant convention in C, Java, hardware specs, and protocol documentation. If you need lowercase (CSS color codes, Unix tools), use String.toLowerCase() on the result — the underlying value is identical.

Is the data sent to a server?

No. All conversion happens in JavaScript inside your browser. Open DevTools → Network and confirm zero requests when you click Convert. Safe for internal IDs, secret tokens, hashes, or proprietary numeric data.

Binary to Hex Converter Online — Free Base-2 to Base-16 Tool