Number base conversion

Hex to Binary Calculator

Convert a whole number from hexadecimal (base 16) to binary (base 2). Each hexadecimal digit corresponds to four bits.

Base 16 input

Enter a hexadecimal integer

Base 16 → 2
Base 2 output

Binary equivalent

The binary value will appear here

Use hexadecimal digits 0–9 and A–F. Letter case does not change the value.

What Is Hexadecimal to Binary Conversion?

The Hex to Binary Calculator converts an unsigned base-16 integer into an exact base-2 digit string. Enter up to 1,000 hexadecimal digits using 0–9 and A–F in either case. Binary value and Binary integer show the same result.

Each hex digit expands to four bits. The converter joins those groups and removes zeroes only from the beginning of the final value. It does not preserve an input’s fixed width, add a prefix, interpret a sign bit or decode the digits into text.

How to Convert Hex Digits to Binary

  1. Enter your digits in Hexadecimal number. Letters A–F stand for 10–15, and lowercase a–f work equally well.
  2. Use one unbroken integer of at most 1,000 digits. Omit 0x, #, spaces, a sign and any radix point.
  3. Select Convert to binary. Read the main Binary value result.
  4. Check the original letter case and padding only if they matter to your record. The numerical result does not preserve those formatting details.
  5. To verify by hand, write exactly four bits for every hex digit, join the groups, then remove leading zeroes from the complete string.

The direction is fixed and there is no width or signed-mode selector. The form treats every accepted character as a hex digit. For example, 1e3 means hexadecimal 1E3 rather than decimal exponent notation.

Hex Digit Values and Four-Bit Mapping

Hex digit value = 8 × b₃ + 4 × b₂ + 2 × b₁ + b₀

Binary result = joined four-bit groups with leading zeroes removed

The bit weights within a hex digit are 8, 4, 2 and 1. For A, the value 10 becomes 1010; for 3, the value becomes 0011. McMaster’s number-system notes explain the four-bit hexadecimal relationship.

Keep each group at four positions until joining. Hex 13 expands to 0001 | 0011, which joins as 00010011 and displays as 10011. Shortening each group first would join 1 and 11, wrongly producing 111.

NPTEL’s discussion of hexadecimal and binary explains the positional relationship. The implementation uses a lookup table rather than converting the whole number through floating-point arithmetic. Both the API and renderer keep the returned binary digits as text.

Only leading padding is removed. Interior groups such as 0000 remain, and an all-zero input returns a single 0. There is no numerical rounding or automatic restoration of a register width.

Hex Input, Bit Groups and Binary Result

Hexadecimal number
An unsigned base-16 integer of up to 1,000 digits. Accepted letters A–F are case-insensitive.
Four-bit group
The intermediate representation of one hex digit, retaining all four positions. The form does not display a generated grouping card.
Binary value / Binary integer
The same exact base-2 string in the main result card. It omits leading zeroes and has no prefix or sign interpretation.

Hex to Binary Worked Example

Illustrative example. Enter A3C. A maps to 1010, 3 maps to 0011 and C maps to 1100.

Join the groups: 1010 | 0011 | 1100. The displayed binary integer is 101000111100. The first bit is already 1, so no leading padding needs removal.

For a separate value check, hex A3C equals 10×256 + 3×16 + 12 = 2620. The binary result has the same decimal value. Lowercase a3c and leading-zero input 00A3C produce the same normalized binary output.

Calculation check. Independent positional sums, Python integer conversion and the endpoint agree. For a width example, hex 02 maps internally to 00000010 but displays as 10; the page preserves the value rather than eight written positions.

Example breakdown. The table follows the grouping rules explained above.

Illustrative exact outputs after leading-zero normalization
Hex inputBinary output
A3C101000111100
00a3c101000111100
1310011
0000

Hex Digit Map, Interior Zeroes and Bit Width

Every hex digit has a four-position binary group. A–F stand for 10–15. Keep the full group for every digit until the complete binary string has been joined.

Complete hexadecimal digit to four-bit mapping
Hex digitBinary group
00000
10001
20010
30011
40100
50101
60110
70111
81000
91001
A1010
B1011
C1100
D1101
E1110
F1111

For hex 13, join 0001 and 0011 to obtain 00010011, then remove only the initial padding to get 10011. Removing zeroes within the groups first produces the wrong integer.

The normalized output does not carry an original byte or register width. For example, hex 02 becomes binary 10 rather than 00000010. If another task requires eight positions, record and apply that width separately; it is not selected in this form.

How to Read the Binary Result

The output is one unsigned binary integer. Its digit count need not be four times the input length because the page removes leading zeroes. An input starting with a high-valued digit such as A can use all four positions, while a low first digit may not.

Zeroes inside the significant result are not optional. In A3C, the two initial zeroes of the middle 0011 group help keep C in its correct position. Deleting those positions changes the integer.

A four-bit group is often called a nibble. Two such groups can describe eight bits, but this converter does not enforce byte boundaries, choose an endianness or provide a byte-array view. It processes one integer in written digit order.

The same pattern may represent signed data in another system. This page has no word-size or two’s-complement setting, so it does not decide whether a leading 1 should be read as negative. It also does not translate ASCII or Unicode.

At the 1,000-hex-digit input limit, the binary result can reach 4,000 bits. The related Binary to Hex tool accepts only 1,000 bits, so a long result may exceed that page’s reverse-input limit. Keep the original number and its required width when transferring data.

Common Hex to Binary Mistakes

  • Pasting a 0x prefix, # marker or grouping spaces.
  • Removing zeroes from each hex digit’s group before joining.
  • Dropping interior zero groups.
  • Expecting exactly four output bits per input digit after normalization.
  • Treating exponent-looking hex such as 1e3 as decimal scientific notation.
  • Assuming a leading 1 means negative in this unsigned tool.
  • Confusing integer conversion with text decoding or byte-order reversal.

Hex to Binary Questions

How do I turn hex into binary?

Replace each hex digit with four bits, join the groups and remove only leading zeroes from the complete result. The converter keeps the exact integer value.

Why does one hex digit correspond to four bits?

Four bits have sixteen patterns because 2⁴ = 16. These cover the sixteen hex digit values 0 through F.

Does uppercase or lowercase affect the result?

No. A–F and a–f mean the same values. For example, A3C and a3c produce identical binary results.

Why does hex 02 become binary 10?

The internal eight-position form is 00000010, but this page removes leading zeroes. It has no fixed-width setting.

Should I keep zeroes inside each four-bit group?

Yes. Keep every group at four positions until joining; only the leading padding of the complete result can be removed without changing its unsigned value.

Can the result represent a negative or signed value?

This page does not make that interpretation. Signed data requires a specified format and width, neither of which is selected here.

Can I enter prefixes, fractions or negative numbers?

No. Enter only unsigned hex digits, without 0x, #, a sign, internal spaces or a radix point.

Can I reverse a long result with Binary to Hex?

Only if it fits that tool’s separate 1,000-bit input limit. This page can produce up to 4,000 bits from 1,000 hex digits.

Sources and References