Binary to Decimal Converter
The decimal and hex value of any binary number, spaces ignored.
Result
How it is calculated
The input is stripped of all spaces, so 1111 0000 is read as 11110000. It must then consist only of the digits 0 and 1. The value is computed as decimal = Σ dᵢ × 2i, where dᵢ is the digit at position i counted from the right starting at 0. The hexadecimal output is the same number written in base 16 with an 0x prefix and upper-case letters. Leading zeros are ignored, and an input of only zeros gives 0 (0x0). The converter handles unsigned values of up to 63 binary digits after leading zeros are removed, i.e. up to 9223372036854775807; a longer string, or one containing any other character (a minus sign, a decimal point, the digit 2), returns no result. It does not interpret the leading bit as a sign.
Worked example
Take 110101101, which has nine digits. Reading from the left, the place values are 256, 128, 64, 32, 16, 8, 4, 2, 1 and the digits are 1, 1, 0, 1, 0, 1, 1, 0, 1. Adding the places holding a 1 gives 256 + 128 + 32 + 8 + 4 + 1 = 429. Regrouping the bits in fours from the right (1 / 1010 / 1101) gives the hex digits 1, A and D, so the hex output is 0x1AD.
Common mistakes
- Pasting a binary number with a prefix such as
0bor a trailingb. Only 0 and 1 are accepted, so the letter makes the input invalid; remove the prefix first. - Expecting two's-complement negative numbers. A string like
11111111is read as 255, not -1, because the tool never treats the leading bit as a sign. - Entering fractional binary such as
101.1. A point is rejected; the tool only converts whole numbers. - Counting positions from the left instead of the right. The rightmost digit is worth 1, so reversing the string gives a completely different value.
- Pasting a 64-bit all-ones value. Anything longer than 63 digits after leading zeros is refused rather than rounded.
About this calculator
Binary (base 2) represents every number using only 0s and 1s, where each digit's place value doubles moving left — 1, 2, 4, 8, 16... To convert to decimal (base 10), you multiply each binary digit by its place value and sum the results (e.g. 1011₂ = 1×8 + 0×4 + 1×2 + 1×1 = 11); converting to hexadecimal (base 16) groups the binary digits into sets of four, each mapping directly to one hex digit (0-9, A-F).
Computer science students learn this conversion as a foundation for understanding how computers represent data, while programmers, network engineers, and hardware/firmware developers use it routinely to read memory addresses, IP subnet masks, bitwise flags, and register values that are natively expressed in binary or hex.
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)
Network work is a typical use, with one catch: dotted notation is rejected, so convert each octet separately. In a subnet mask, 11111000 gives 248 (0xF8) and 11111111 gives 255, which is how a mask of 255.255.248.0 is read. Eight ones always give 255 and eight zeros give 0. Here the octet shows how many network bits are set. Are you decoding masks and addresses, or flags and register values?