Programmer Calculator
Convert integers between binary, octal, decimal and hexadecimal.
About the Programmer Calculator
A programmer's calculator that converts a whole number between binary, octal, decimal and hexadecimal bases, and shows bitwise representations.
How to use this calculator
- Enter the integer you want to convert, such as 42.
- Choose the number system it starts in, for example decimal.
- Select the output base you want, such as binary, octal, or hexadecimal.
- Read the converted value and the step-by-step conversion shown by the calculator.
The formula explained
This tool converts one whole number from a chosen base into another base. It computes the same value in a different numeral system, not a different number.
- n = the integer being converted
- b = the base or number system, such as 2, 8, 10, or 16
Step by step method
- Start with the given number in its original base.
- Convert it to a decimal value if needed, because decimal is the easiest bridge between bases.
- Rewrite that decimal value in the new base by repeated division and recording remainders.
Worked example
Problem. Convert 42 from decimal to binary, octal, and hexadecimal.
- Decimal 42 stays 42 in base 10.
- For binary, divide by 2 repeatedly: 42, 21 r0, 10 r1, 5 r0, 2 r1, 1 r0, so the binary form is 101010.
- For octal, divide by 8: 42, 5 r2, 0 r5, so the octal form is 52. For hexadecimal, divide by 16: 42, 2 r10, and remainder 10 is A, so the hexadecimal form is 2A.
Answer. 42 = 101010₂ = 52₈ = 2A₁₆
Tips and common mistakes
- Remember that hexadecimal uses A through F for values 10 through 15.
- A common mistake is mixing up the base, so check whether the input number is binary, octal, decimal, or hexadecimal before converting.
Frequently asked questions
Which bases are supported?+
Binary (2), octal (8), decimal (10) and hexadecimal (16).
Can I enter hex letters?+
Yes, when the input base is hex, use 0 to 9 and A-F.
More Mathematics Tools
Explore related calculators in this category
Absolute Value Calculator
Calculate the absolute value of any number. Use this free calculator for fast, accurate answers, complete with the formula and a worked example.
Absolute Value Equation Solver
Solve equations of the form |ax + b| = c.
Absolute Value Grapher
Plot y = |f(x)| and see the characteristic V-shape and reflections.
Adding Fractions Calculator
Add two fractions with step-by-step simplification.
You Might Also Like
Popular tools from other categories
.htaccess Generator
Generate common .htaccess rules, force HTTPS, www redirect, and caching, with checkboxes.
1031 Exchange Calculator - Free Online
Free Calculate tax deferral in a 1031 exchange. Step-by-step solutions and formulas included. Fast, accurate, and free, with formula and example.
4% Rule Calculator
Find the retirement nest egg you need using the 4% safe-withdrawal rule.
70% Rule Calculator
Calculate max offer using the 70% rule for flips.
Can't Find the Right Calculator?
Try our AI Math Solver, type any problem in plain English and get instant step-by-step solutions.