Basic Calculator: Add, Subtract, Multiply, Divide and Percent
Type a calculation or use the keys. The answer shows as you go, brackets and the order of operations are respected, and 0.1 + 0.2 is exactly 0.3.
Last reviewed
Answer
50
Worked in exact decimals, so 0.1 + 0.2 is 0.3. Order of operations applies, and 200 + 10% means 200 plus 10% of 200.
A calculator that does the sums correctly
This is a plain calculator for everyday arithmetic: adding, subtracting, multiplying, dividing, powers, brackets and percent. You can type a whole calculation into the line or build it with the keys, and the answer appears as you go. Press = or Enter to add it to the history, and click an item in the history to bring it back.
It works in exact decimals, follows the order of operations, and treats percent the way a pocket calculator does.
Exact decimals
Most software stores numbers as binary fractions, which cannot hold a number such as 0.1 exactly. That is why many programs show 0.1 + 0.2 as 0.30000000000000004. This calculator does every step in exact decimal arithmetic.
- 0.1 + 0.2 = 0.3.
- 1 ÷ 3 × 3 = 1.
- 1.1 × 1.1 = 1.21.
- 999999999999 × 999999999999 = 999,999,999,998,000,000,000,001, with every digit.
Answers are worked to 40 digits and shown to 15 significant figures, with the full answer given underneath when it is longer.
The order of operations
A calculation is not read simply from left to right. The order is:
- Brackets, innermost first.
- Powers (the ^ key).
- Multiplication and division, from left to right.
- Addition and subtraction, from left to right.
| Calculation | Answer | Why |
|---|---|---|
| 2 + 3 × 4 | 14 | multiply first: 3 × 4 = 12, then add 2 |
| (2 + 3) × 4 | 20 | the brackets make the addition come first |
| 8 ÷ 4 ÷ 2 | 1 | left to right: 8 ÷ 4 = 2, then 2 ÷ 2 |
| 2 − 3 − 4 | −5 | left to right: −1, then −5 |
| 2^3^2 | 512 | powers go right to left: 3² = 9, then 2⁹ |
| −2^2 | −4 | the power comes before the minus sign |
| (−2)^2 | 4 | brackets square the negative number |
Brackets next to numbers
A number or bracket written straight after a bracket is multiplied, as in algebra. 2(3 + 4) is 14, and (1 + 2)(3 + 4) is 21. 6 ÷ 2(1 + 2) is read as 6 ÷ 2 × (1 + 2), left to right, which is 3 × 3 = 9. That line is famous because some calculators and books read it as 6 ÷ (2 × 3) = 1. If you mean that, put in the brackets: 6 ÷ (2(1 + 2)).
Percent
The % key follows the pocket-calculator convention, which has three cases.
- After + or −, it is a share of the number on its left. 200 + 10% is 200 + 20 = 220, and 200 − 10% is 180. 80 + 20% is 96, which is a price with 20% added.
- With × or ÷, it is divided by 100. 200 × 10% is 20, and 15% × 80 is 12.
- On its own, it is a decimal. 50% is 0.5, and (20 + 10)% is 0.3.
Percentages work one step at a time. 50 + 10% is 55, and 55 + 10% is 60.5, so 50 + 10% + 10% is also 60.5. That is 21% more than 50, not 20%, because the second 10% is taken of the larger number. For percentage questions that need more working, such as “what percent is 30 of 200”, use the percentage calculator, and to find a change between two values, the percentage change calculator.
Using it
- Type or tap. The keys put characters where your cursor is, so you can fix a number in the middle of a line.
- Use the keyboard. * and / work for multiply and divide, and Enter works as =.
- Brackets. The ( ) key adds an opening bracket, or a closing one if one is still open.
- History. The last six answers are kept on the page while you use it. Nothing is stored or sent anywhere.
- Share. Copy link puts your calculation in the address so you can send it to someone.
When it says no
Instead of showing a wrong or meaningless number, the calculator explains the problem.
- Division by zero is refused.
- A missing bracket or an operator with nothing after it is pointed out.
- Two numbers with nothing between them, such as 4 5, are an error.
- Functions and constants such as sin and π are on the scientific calculator.
More than the basics
For fractions, with exact answers, there is the fraction calculator. To find an average or a weighted average, use the average calculator, and for a random number, the random number generator.
How it is calculated
The line is read by a parser that follows the order above, and not by evaluating the text, so nothing you type can run as code. Numbers are exact decimals, the arithmetic runs at 40 digits, and the answer is rounded to 30 significant digits and shown to 15. Percent after + or − is the left-hand number times the percentage divided by 100, and elsewhere the percentage divided by 100. Division by zero, an unclosed bracket and results that are too large to handle are reported as errors.
Frequently asked questions
Why does 0.1 + 0.2 equal 0.3 here?
Because the calculator works in exact decimals. Many programs use binary fractions, which cannot hold 0.1 exactly, and show 0.30000000000000004. Here every step is exact, and 1 ÷ 3 × 3 comes out as exactly 1.
How does the percent key work?
After + or − it is a share of the number on its left: 200 + 10% is 200 + 20 = 220, and 100 − 25% is 75. With × or ÷ it is simply divided by 100, so 200 × 10% is 20. On its own, 50% is 0.5.
Does it follow the order of operations?
Yes. Brackets first, then powers, then multiplication and division from left to right, then addition and subtraction. 2 + 3 × 4 is 14, not 20, and (2 + 3) × 4 is 20.
What is −2^2?
It is −4, because the power binds tighter than the minus sign: −(2²). To square a negative number, use brackets: (−2)^2 is 4.
How is 6 ÷ 2(1 + 2) read?
As 6 ÷ 2 × (1 + 2), working left to right, which is 3 × 3 = 9. The same line is read differently by some calculators and textbooks, so add brackets, as 6 ÷ (2(1 + 2)) = 1, if you mean the other reading.
Can I use the keyboard?
Yes. Type into the calculation line, using * or × for multiply and / or ÷ for divide, and press Enter for the equals key. The keys put characters wherever your cursor is.
Related calculators
- Scientific CalculatorType an expression or use the keys.
- Percentage CalculatorPick the question you are actually asking.
- Percentage Change CalculatorEnter a starting and a new value to get the percentage change, or apply a percentage to a value, or find the value before a change.
- Fraction CalculatorEnter two fractions, mixed numbers, whole numbers or decimals and choose an operation.
- Average CalculatorPaste a list of numbers to get the average, with the sum, count, smallest and largest.
- Random Number GeneratorSet a minimum and maximum, how many numbers you want and whether repeats are allowed, then press Generate.