Convert Hex to Binary
Convert hex to binary with nibble-accurate bit widths. 5 grouping modes, 0b prefix toggle, batch mode, per-line errors. Free, offline, 100% client-side.
Convert hexadecimal values to binary via direct nibble expansion (each hex digit = 4 bits). Bit width preserved by default - 0x0A stays 8 bits (00001010), not stripped to 4. Five grouping modes, 0b prefix, batch mode.
How to Use Convert Hex to Binary
- Paste your hex value. The leading
0x/0Xprefix is optional; spaces, underscores (DE_AD_BE_EF), and newlines are all stripped automatically. Case doesn't matter. - Pick a grouping: None (continuous bits), Nibble (4-bit groups), Byte (8-bit groups, default), Word (16 bits), or Dword (32 bits). The output left-pads with zeros so every group lines up.
- Decide about leading zeros. By default, bit width is preserved -
0x0Abecomes 8 bits (00001010). Enable "Strip leading zeros" to get the minimal representation (1010) instead, which matches bare-number conventions but loses bit-width information. - Toggle the
0bprefix if you need Python 3 / ES6 / Rust binary literals. - Enable Batch mode if each input line is a separate hex value. Bad lines show up in the error list below the output; good ones still decode.
- Press Convert (or Ctrl+Enter / Cmd+Enter). Auto-convert fires 200 ms after each keystroke so you see output as you type.
- Read the stats line: it shows the number of hex digits parsed, total bits produced, and byte count. In batch mode it also reports the line-level success and failure count.
Frequently Asked Questions
How does hex-to-binary conversion actually work?
Each hex digit maps directly to 4 binary bits – no arithmetic needed. 0 = 0000, 9 = 1001, A = 1010, F = 1111. The tool walks your hex input character by character and concatenates the matching 4-bit patterns. So FF becomes 1111 + 1111 = 11111111.
Why should I preserve bit width instead of stripping leading zeros?
Because in most real-world uses of hex (memory addresses, network packets, register values, ASCII bytes), the bit width carries meaning. A hex byte is 8 bits – even if its numeric value is small. 0x0A as a byte is 00001010, not 1010. Stripping zeros gives the integer value but loses the size context. Use it only when you want pure number semantics, not byte semantics.
What do the five grouping modes do?
None emits one long continuous bit string. Nibble (4 bits) groups as 0000 1010 (matches hex digit boundaries). Byte (8 bits) groups as 00001010 11111111 (standard for byte-oriented protocols). Word (16 bits) and Dword (32 bits) match common CPU register widths. The underlying bits are identical – only the visual spacing and left-padding change.
How big a hex value can I convert?
Practically unlimited. The algorithm is O(n) in hex length and uses plain strings – no `Number` or `BigInt` arithmetic is performed (each hex digit just looks up its 4-bit pattern in a table). 1 MB of hex input (2 million bits of output) finishes in under 50 ms on a modern laptop.
What input formats does the tool accept?
Bare hex digits (FF), with 0x/0X prefix (0xFF), space-separated (FF 00), underscore-separated (FF_00 or DE_AD_BE_EF), or any mix. Case is irrelevant – aB and AB and Ab all decode identically.
What happens to odd-length hex input?
It still works – each hex digit is 4 bits regardless of whether the total is a multiple of 2 (nibble) or 8 (byte). 0x1ABCD has 5 hex digits = 20 bits. With byte grouping on, the output left-pads to 24 bits so the groups align, but the underlying value is unchanged. There’s no “must be a whole number of bytes” restriction.
When would I use batch mode?
When each line of input is a separate hex value – maybe a column of register dumps from a debugger, or a list of IP addresses in hex, or a file offset table. Batch mode decodes each line independently. If one line has a typo, only that line fails (shown in the error list below the output); every other line still converts.
Does this tool handle negative hex?
Not directly – hex-to-binary is a representation mapping, not arithmetic. If you want the binary of -5, you need two’s complement encoding (which requires a chosen bit width, usually 8/16/32/64 bits). Use our “decimal to two’s complement binary” tool for that. This tool treats all input as non-negative magnitudes.
Is my input uploaded anywhere?
No. All processing happens in your browser’s JavaScript engine – no network requests fire during conversion, and no server stores or logs your hex values. You can verify with your browser’s Network tab. The tool works offline after the initial page load.
Can I round-trip binary back to hex?
Yes. The mapping is bijective for any multiple-of-4-bit binary string. Use our “binary to hex” converter (or any binary-to-hex tool) and you’ll recover the original hex exactly – assuming your binary input has a multiple of 4 bits (which it will if you got it from this tool). For non-4-divisible bit widths, the converter usually left-pads with zeros.
Related Tools
Add Hex Numbers →
Add Hex Numbers instantly. Free, offline, client-side tool that outputs results in both hex…
ASCII to Hex Converter →
Convert ASCII to Hex - code points or UTF-8 bytes, space/comma/0x-prefixed, uppercase or lowercase.…
Base32 to Hex Converter →
Base32 to Hex Converter - pick separator, case, and prefix. Free, client-side, instant, offline,…
Base58 to Hex Converter →
Decode Bitcoin, Ripple, or Flickr Base58 strings to hex - with separator, case, and…
Base64 to Hex Decoder →
Decode Base64 to hex bytes - URL-safe variant, separator options, uppercase toggle, UTF-8 aware.…
BCD to Hex Converter →
Convert packed BCD to hexadecimal - decimal-value or nibble mode, BigInt precision, COMP-3 sign.…