Number Base Converter
How do I convert number bases?
Result
How it is calculated
Choose the base of the number you are typing (2, 8, 10 or 16) and the tool shows it in all four bases at once. It first reads the number in its own base to get a plain integer, then writes that integer in binary (digits 0-1), octal (0-7), decimal (0-9) and hexadecimal (0-9 and A-F). In any base the value is Σ digit × baseposition, counting positions from 0 on the right.
Only non-negative whole numbers are supported: no minus sign, fraction or prefix such as 0x or 0b. If a character is not a valid digit for the chosen base (for example 9 in binary, or G in hex) the tool reports an invalid number instead. Hex letters can be typed in upper or lower case, and the output uses capitals. Values above 9,223,372,036,854,775,807 (2^63 − 1) give no result.
Worked example
Convert decimal 255. Binary: 255 = 128 + 64 + 32 + 16 + 8 + 4 + 2 + 1, so every one of the 8 bits is set and the binary form is 11111111. Octal groups the bits in threes (11 111 111), giving 377. Hexadecimal groups them in fours (1111 1111), and each group is F, giving FF. The decimal value stays 255.
Common mistakes
- Leaving the input base on decimal while typing a binary or hex value; 101 means one hundred and one in decimal but 5 in binary.
- Typing a prefix like
0xFFor0b1010. Enter only the digits, FF or 1010. - Entering a negative number or one with a decimal point; only non-negative integers are converted.
- Confusing the letter O with zero, or a lowercase l with one, in hex and binary input.
About this calculator
This tool converts a number between the four bases most commonly used in computing and mathematics — binary (base 2), octal (base 8), decimal (base 10) and hexadecimal (base 16) — by interpreting the input in its source base and re-expressing the same value using each target base's digit set. Binary uses only 0 and 1, hex extends beyond 9 into the letters A–F, and the calculator handles the underlying place-value math automatically in either direction.
Programmers and computer science students use base conversion constantly, since computers store data in binary at the hardware level but binary numbers become unreadably long, so hexadecimal is used as compact shorthand in memory addresses, color codes and low-level debugging, while octal still appears in older systems and file permission notation. Anyone learning how computers represent numbers internally, or needing to manually check a hex or binary value against its decimal equivalent, relies on a converter like this rather than doing the place-value arithmetic by hand.
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)
The binary result has no leading zeros, so 5 appears as 101 rather than 00000101. If you work with 8-bit bytes or IPv4 octets, pad it with zeros on the left yourself. For a web colour such as FF8800, convert each pair of hex digits separately and you get the red, green and blue values from 0 to 255. Enter hex digits only, with no hash sign or 0x prefix. Which other base would you like handled here?