Order of Operations

An expression like 8 − 2 × 3 has one agreed answer (2, not 18) because mathematicians use a fixed order for applying operations. Here is that order and the traps people fall into.

The order

  1. Parentheses / brackets — work out anything inside them first, innermost first.
  2. Exponents / orders — powers and roots.
  3. Multiplication and division — together, from left to right.
  4. Addition and subtraction — together, from left to right.

PEMDAS (US), BODMAS and BIDMAS (UK) and BEDMAS (Canada) are all the same rule with different words for brackets and exponents. The acronyms can mislead: M does not come before D, and A does not come before S. Each pair has equal rank and is done left to right.

Worked examples

8 − 2 × 3

  1. Multiplication first: 2 × 3 = 6
  2. Then subtraction: 8 − 6 = 2

2

20 ÷ 4 × 5

  1. Division and multiplication have equal rank: go left to right
  2. 20 ÷ 4 = 5
  3. 5 × 5 = 25

25 (not 1)

10 − 4 + 3

  1. Subtraction and addition have equal rank: go left to right
  2. 10 − 4 = 6
  3. 6 + 3 = 9

9 (not 3)

3 + 2 × (7 − 4)²

  1. Brackets: 7 − 4 = 3
  2. Exponent: 3² = 9
  3. Multiply: 2 × 9 = 18
  4. Add: 3 + 18 = 21

21

Common traps

  • Negative numbers and powers. −3² means −(3²) = −9, because the exponent binds tighter than the minus sign. Write (−3)² = 9 if you mean the square of −3.
  • Stacked exponents. 2^3^2 is evaluated from the top down (right to left): 2^(3^2) = 2⁹ = 512, not (2³)² = 64.
  • Fraction bars group. In (6 + 4) / (2 + 3) written as a stacked fraction, the whole top and whole bottom are computed first: 10 ÷ 5 = 2.
  • Implied multiplication. Expressions such as 6 ÷ 2(1 + 2) are genuinely ambiguous — some conventions treat 2(1 + 2) as a single unit. Add brackets to say what you mean rather than relying on a rule.
  • Percent keys. Pocket calculators handle % differently from the written rules; see the percentage calculator for unambiguous percentage work.

How calculators apply it

The scientific calculator on this site follows these rules: brackets, then powers (right-associative), then unary minus, then × and ÷ left to right, then + and − left to right. Basic four-function calculators often do not — they apply each operation as soon as you press the next key, so 2 + 3 × 4 gives 20 instead of 14.