Question · Online Calculator

What is the order of operations?

Short answer

The order of operations is the rule for which part of a calculation is done first: brackets, then exponents, then multiplication and division, then addition and subtraction. Operations of the same rank go from left to right. So 2 + 3 × 4 is 14, not 20: the multiplication comes before the addition.

The rule, step by step

StepWhatExample
1Brackets (parentheses)(2 + 3) × 4 = 5 × 4 = 20
2Exponents (powers)2 + 3² = 2 + 9 = 11
3Multiplication and division, left to right24 ÷ 4 × 2 = 6 × 2 = 12
4Addition and subtraction, left to right10 − 2 − 3 = 8 − 3 = 5

In the US the rule is remembered as PEMDAS: Parentheses, Exponents, Multiplication/Division, Addition/Subtraction. In the UK and many Commonwealth countries it is BODMAS: Brackets, Of, Division/Multiplication, Addition/Subtraction (Wikipedia).

Why do two calculators give different answers?

Not every calculator follows the rule. Simple calculators with "chain input" work in the order you press the buttons, so 1 + 2 × 3 = gives 9 on a simple calculator and 7 on a more sophisticated one (Wikipedia).

If two calculators disagree, check which one applies the order of operations, or add brackets so the order is clear to both.

Does Online Calculator follow the order of operations?

Yes. Online Calculator reads the whole line before it calculates: brackets first, then multiplication and division, then addition and subtraction, left to right. It has no exponent key, so steps 1, 3 and 4 apply.

You typeAnswer
1 + 2 × 37
12 − 4 ÷ 210
(12 − 4) ÷ 24
24 ÷ 4 × 212
2 × (3 + 4)14

When you type on the keyboard, put the sign before a bracket yourself: 2*(3+4), not 2(3+4). The ( key in the window adds the × after a number for you.

When do brackets help?

Whenever you want something added or subtracted before it is multiplied or divided. The average of 12 and 8 is (12 + 8) ÷ 2 = 10. Without brackets, 12 + 8 ÷ 2 is 16, because the division comes first.

Sources

More Online Calculator answers

All Online Calculator guides and answers