User Rating 0.0
Total Usage 0 times
Accepts 0-9, A-F. Prefixes (0x, #) and separators (spaces, colons, dashes) are auto-stripped.
0 hex chars → 0 bits
Examples:
Binary Output
Binary result will appear here
Is this tool helpful?

Your feedback helps us improve.

About

Hexadecimal notation compresses binary data by a factor of 4: each hex digit maps to exactly 4 binary bits. Misreading a single nibble - confusing B (1011) with D (1101) - flips two bits simultaneously, which in register-level firmware or network mask configuration causes silent, hard-to-trace failures. This converter performs a deterministic lookup per digit, preserving leading zeros so the output width always equals 4n bits for n hex characters. It handles arbitrary-length input, not just 8-, 16-, or 32-bit words.

The tool assumes unsigned interpretation. It does not infer signedness or endianness - those are context-dependent decisions the engineer must make. For IEEE 754 floats or two's complement integers, convert here first, then apply the sign/exponent logic appropriate to your architecture.

hex to binary hexadecimal converter binary converter hex2bin number base conversion programming tools

Formulas

The conversion is a direct substitution cipher. Each hexadecimal digit is replaced by its fixed 4-bit binary equivalent from a lookup table T.

hex2bin(H) = T[H0] T[H1] T[Hn1]

Where H is the input hex string of length n, Hi is the i-th character, T is the nibble lookup table mapping 0 - F0000 - 1111, and denotes string concatenation. The output length is always 4n bits. No arithmetic is performed - the mapping is purely lexical.

For the reverse verification: bin2hex(B) groups the binary string into 4-bit chunks from the right, padding with leading zeros if len(B) mod 4 0, then applies the inverse table T1.

Reference Data

Hex DigitDecimalBinary (4-bit)Octal
0000000
1100011
2200102
3300113
4401004
5501015
6601106
7701117
88100010
99100111
A10101012
B11101113
C12110014
D13110115
E14111016
F15111117
FF25511111111377
1A260001101032
7F12701111111177
8012810000000200
FFFF655351111111111111111177777
DEAD570051101111010101101157255
BEEF488791011111011101111137357
CAFE519661100101011111110145376
0A100000101012
10160001000020
100256000100000000400

Frequently Asked Questions

Each hex digit maps to exactly 4 binary bits. Stripping leading zeros destroys the fixed-width property, making it impossible to reconstruct the original hex without knowing the intended byte boundaries. For register values, memory addresses, and protocol fields, leading zeros carry positional meaning. This tool preserves them by default but offers a toggle to strip them if you need a minimal representation.
The converter automatically strips the 0x and 0X prefixes before conversion. It also ignores spaces and common delimiters (colons, dashes) so you can paste MAC addresses (AA:BB:CC:DD:EE:FF) or formatted hex dumps directly.
There is no hard limit beyond browser memory. The algorithm is O(n) with constant work per character (a single table lookup). A 10,000-character hex string (40,000 binary digits) converts in under 1 millisecond on modern hardware. For extremely large inputs (megabytes of hex), the bottleneck is DOM rendering of the output, not the conversion itself.
No. This tool performs unsigned base conversion only. Two's complement sign interpretation and IEEE 754 float decoding depend on word size and architecture, which are context-dependent. Convert your hex to binary here first, then apply the sign bit or exponent-mantissa split according to your target specification (e.g., 32-bit float: 1 sign + 8 exponent + 23 mantissa bits).
Endianness affects byte order, not nibble-to-bit mapping. The hex string AABB always converts to 1010101010111011 regardless of endianness. However, if you read AABB from memory on a little-endian machine, the bytes were stored as BB AA. You must swap bytes before converting if you need the in-memory representation. This tool converts the string as written, left to right.
Yes. Paste FF5733 (with or without the # prefix) and the converter produces 111111110101011100110011. The first 8 bits are the red channel, the next 8 green, and the last 8 blue. The tool's 4-bit or 8-bit grouping option makes the channel boundaries visually clear.