Skip to content

The order of operations, and why PEMDAS needs care

The order of operations is the agreed order for working out an expression: first anything in grouping symbols, then exponents, then multiplication and division from left to right, then addition and subtraction from left to right. PEMDAS, BODMAS and GEMS are memory aids for the same rule. Multiplication does not always come before division, and addition does not always come before subtraction: each pair shares a rank and is done left to right.

Why there has to be an agreed order

Take 3 + 4 × 2. If you add first you get 14; if you multiply first you get 11. Both answers cannot be right, so mathematicians agree on one order, and everyone who follows it gets 11.

The rule is not arbitrary. Multiplication is repeated addition, so it binds numbers more tightly than addition does, and an exponent is repeated multiplication, so it binds tighter still. The order of operations simply does the most tightly bound operations first.

Calculators, spreadsheets and programming languages all follow the same convention, which is why typing an expression in the wrong way gives a surprising answer.

The four levels, from first to last

Think of the order as four levels rather than six separate letters:

PEMDAS, BODMAS and GEMS

In the United States students often learn PEMDAS: Parentheses, Exponents, Multiplication, Division, Addition, Subtraction, sometimes remembered as Please Excuse My Dear Aunt Sally. In the UK, Canada and elsewhere it is BODMAS or BIDMAS, where B is brackets and O or I is orders or indices. GEMS (Grouping, Exponents, Multiply or divide, Subtract or add) is another version.

All three describe the same rule. The weakness of PEMDAS is that it lists M before D and A before S, which tempts students to multiply before dividing. BODMAS has the opposite problem, listing D before M. Neither letter order is a rule: in each pair, whichever comes first reading left to right goes first.

Worked example: grouping and exponents

Write a new line for each step and rewrite everything you have not used yet. Skipping that habit is how terms get lost.

ProblemEvaluate 8+2×(7−3)2÷4

  1. 8+2×42÷4

    Parentheses first: 7 − 3 is 4.

  2. 8+2×16÷4

    Exponent next: 4 squared is 16.

  3. 8+32÷4

    Multiply and divide from left to right; the multiplication comes first here, so 2 × 16 is 32.

  4. 8+8

    Then 32 ÷ 4 is 8.

  5. 16

    Addition last.

Answer16

Worked example: left to right matters

This one has no parentheses, and it is where most errors happen. Doing the multiplication before the division would give 24 ÷ 12, which is 2, and change the final answer.

ProblemEvaluate 24÷4×3−6+2

  1. 6×3−6+2

    Division and multiplication share a level, so go left to right: 24 ÷ 4 comes first and is 6.

  2. 18−6+2

    Then 6 × 3 is 18.

  3. 12+2

    Subtraction and addition share a level too, so go left to right: 18 − 6 is 12.

  4. 14

    Adding first would give 18 − 8, which is 10, the wrong answer.

Answer14

Worked example: a fraction bar and a negative sign

A fraction bar groups everything above it and everything below it, as if each had its own parentheses. A minus sign in front of a power is applied after the power, unless parentheses say otherwise.

ProblemEvaluate −22+18−3⋅42

  1. 18−3⋅4=18−12=6

    Work the numerator as its own group: multiply before subtracting.

  2. 62=3

    Now the fraction is a single division.

  3. −22=−4

    The exponent belongs to the 2 only: square 2 to get 4, then apply the minus sign. (−2)² would be 4.

  4. −4+3=−1

    Add the two parts.

Answer−1

Common mistakes

Nearly every order of operations error comes from one of these:

The viral puzzles, such as 6 ÷ 2(1 + 2)

Puzzles like 6 ÷ 2(1 + 2) circulate online because they are deliberately ambiguous. Following the standard rule strictly, you work the parentheses to get 6 ÷ 2 × 3, then go left to right: 3 × 3 is 9. Some people, and some older textbooks and calculators, treat a number written right next to parentheses as more tightly bound, which gives 6 ÷ 6, or 1.

The honest lesson is that good mathematical writing avoids this form. Writing 6 ÷ 2 × (1 + 2), (6 ÷ 2)(1 + 2), or 6 over 2(1 + 2) as a stacked fraction removes all doubt. In school, the expected answer under PEMDAS is 9.

How to practise and check your work

Underline the operation you are about to do before you do it, and write one new line per step. When you finish, check with a calculator, entering the expression exactly as written; if the answers differ, the step where you disagree is usually a left to right slip or a sign.

A good exercise is to take one string of numbers, such as 2, 3, 4 and 5 with + and ×, and see how many different answers you can make by placing parentheses in different spots. It shows why the agreed order matters.

Questions

What is the correct order of operations?

Grouping symbols first, then exponents, then multiplication and division from left to right, then addition and subtraction from left to right.

Does multiplication come before division?

No. Multiplication and division have the same rank. Work whichever comes first when reading from left to right.

What is the difference between PEMDAS and BODMAS?

They are two memory aids for the same rule. PEMDAS says parentheses and exponents; BODMAS says brackets and orders. Both are worked with the same left to right pairs.

Is −3 squared 9 or −9?

Written as −3² it is −9, because the exponent is applied before the negative sign. Written as (−3)² it is 9.

What grade learns the order of operations?

Students start using parentheses in expressions in grade 5, add exponents in grade 6, and apply the order with negative numbers in grade 7.