Binary to Hexadecimal Converter
Enter a number and pick the conversion direction.
Result
How it is calculated
Binary to hex: the bit string is padded on the left with zeros to a multiple of 4, cut into groups of four bits (nibbles), and each nibble becomes one hex digit, printed in uppercase (1010 = A). Hex to binary: each hex digit is expanded to four bits, then leading zeros are removed, keeping at least one digit. The decimal line is the exact value Σ digit × baseposition, with positions counted from the right starting at 0; it is computed with whole-number arithmetic, so even a 64-bit all-ones input gives 18,446,744,073,709,551,615. The length line counts the bits or hex digits you typed. Input must contain only 0 and 1, or 0–9 and A–F (either case), up to 4096 bits or 1024 hex digits; longer input shows no result.
Worked example
Convert the binary number 110101111010. It has 12 bits, already a multiple of 4. Split it into 1101, 0111 and 1010. These nibbles are 13, 7 and 10, which are the hex digits D, 7 and A, so the result is D7A. Check in decimal: 13 × 256 + 7 × 16 + 10 = 3,328 + 112 + 10 = 3,450. The tool reports D7A, decimal 3,450 and a length of 12 bits.
Common mistakes
- Typing spaces between nibbles (1101 0111 1010) or a
0xprefix. Both make the tool show no result; remove them first. - Grouping the bits from the left. The groups of four must start from the right, which is why 11010 is padded to 00011010 and gives 1A, not D0.
- Expecting leading zeros back in hex to binary.
00FFbecomes 11111111, while the length line still counts the four digits you typed. - Leaving the direction on binary to hex when the input is hex. A value like FF is then rejected because it contains letters.
- Pasting a very long string without checking its size. Binary above 4096 bits or hex above 1024 digits is refused rather than truncated.
About this calculator
Binary and hexadecimal are both positional number systems used throughout computing — binary (base 2) reflects how hardware stores data as on/off bits, while hexadecimal (base 16) packs exactly four bits into each digit, making it a compact, human-readable shorthand for binary strings. This converter moves in either direction, showing the matching decimal value and bit/digit length alongside the result.
Hex-binary conversion is a daily task for software developers, network engineers, and computer science students — reading memory addresses and dumps, decoding color codes (like #FF00FF), configuring subnet masks and MAC addresses, and working with low-level protocols where data is typically documented in hex but processed in binary at the hardware level.
Was this helpful?
You can pick up to 3 reactions.
Popular calculators
Loan Calculator
Monthly payment, total interest and full amortization schedule.
Percentage Calculator
Percent change, percent of, and ratio calculations.
Discount Calculator
Calculate final price, savings, and discount amount.
BMI Calculator
Body mass index from height and weight (metric or imperial).
Age Calculator
Compute your exact age in years, months and days from a birth date.
Compound Interest Calculator
Calculate the final amount and interest earned with compounding.
All Calculators
- Loan Calculator
- Profit Calculator
- Discount Calculator
- BMI Calculator
- Percentage Calculator
- Ideal Weight Calculator
- Age Calculator
- Pregnancy Due Date Calculator
- Compound Interest Calculator
- BMR Calculator (Basal Metabolic Rate)
- Tip Calculator
- Fuel Cost Calculator
- Date Difference Calculator
- Sleep Cycle Calculator
- Daily Water Intake Calculator
- Simple Interest Calculator
- Heart Rate Zones Calculator
- Running Pace Calculator
- Pet Age Calculator
- Calories Burned Calculator
- Macro Calculator
- TDEE Calculator (Total Daily Energy Expenditure)
- Waist-to-Hip Ratio Calculator
- Honor Roll Calculator
- One Rep Max (1RM) Calculator
- Ovulation Calculator
- Electricity Cost Calculator
- Unit Price Calculator
- Savings Goal Calculator
- Break-Even Point Calculator
- Paint Calculator
- Course Grade Average Calculator
- Business Days Calculator
- Time Duration Calculator
- Fuel Economy Calculator
- Temperature Converter
- Tile Calculator
- Aspect Ratio Calculator
- Roman Numeral Converter
- Goal Weight Timeline Calculator
- Salary Converter (Hourly to Annual)
- Credit Card Validator (Luhn)
- Body Surface Area (BSA) Calculator
- Feels-Like Temperature Calculator
- Ohm’s Law Calculator
- PPI (Pixel Density) Calculator
- Molar Mass Calculator
- Zodiac Sign Calculator (Western + Chinese)
- IBAN Validator
- Shoe Size Converter
- Country Info & Dialing Code Lookup
- Time Zone Difference (World Clock)
- CAGR (Compound Annual Growth Rate) Calculator
- Rule of 72 Calculator
- Blood Alcohol Content (BAC) Calculator
- Lean Body Mass (LBM) Calculator
- Pythagorean Theorem Calculator
- Speed Converter
- Download Time Calculator
- Date Calculator (Add/Subtract)
No calculators found
Comments (1)
Colour codes make a good practice case. The hex value FF00FF, magenta, has 6 digits and expands to 24 bits: 111111110000000011111111, which is 16,711,935 in decimal. The length line reports the 6 digits you typed, not the 24 bits, so keep the two straight. In the other direction, the bit count tells you how many leading zeros to restore if you need a fixed width. What width do you usually work with, 8, 16 or 32 bits?