Skip to content
Tutorials Center
My learning

Topics

Lesson 4 of 39 · Getting Started

Order of Operations

Learn the agreed order for evaluating expressions with brackets, powers, multiplication, division, addition and subtraction, with worked examples.

What is 2 + 3 × 4? If you add first you get 20. If you multiply first you get 14. The same marks on the page cannot mean two different things, so mathematicians agreed on one order of operations. Everyone who follows it gets the same answer.

The rule

Work in this order:

  1. Brackets (parentheses), innermost first.
  2. Orders: powers and roots, such as 3² or √16.
  3. Division and multiplication, from left to right.
  4. Addition and subtraction, from left to right.

Some countries remember this as BODMAS (Brackets, Orders, Division, Multiplication, Addition, Subtraction) and others as PEMDAS (Parentheses, Exponents, Multiplication, Division, Addition, Subtraction). They describe the same rule.

Multiplication and division share one level, and addition and subtraction share another. Do not always do division before multiplication or addition before subtraction. Go left to right within a level.

Worked examples

Example 1: 2 + 3 × 4. Multiplication first: 3 × 4 = 12. Then 2 + 12 = 14.

Example 2: (2 + 3) × 4. Brackets first: 5 × 4 = 20. Brackets change the order.

Example 3: 20 - 6 ÷ 3 + 1. Division first: 6 ÷ 3 = 2. Then left to right: 20 - 2 = 18, 18 + 1 = 19.

Example 4: 48 ÷ 6 × 2. Same level, so go left to right: 48 ÷ 6 = 8, then 8 × 2 = 16. It is not 48 ÷ 12 = 4.

Example 5: 3 + 2² × (7 - 4). Brackets: 7 - 4 = 3. Powers: 2² = 4. Multiply: 4 × 3 = 12. Add: 3 + 12 = 15.

Letting Python check your work

Python follows the same order of operations, with ** for powers. That makes it a good way to test your hand calculations.

Python Evaluate expressions

Press Run (or Ctrl + Enter) to see the result here.

Program input · what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Note that Python's / gives decimal results, so 20 - 6 / 3 + 1 prints 19.0. The value is the same as 19.

Brackets inside brackets

When brackets are nested, start with the innermost pair and work outward.

2 × [3 + (8 - 5) × 2]

  1. Innermost: 8 - 5 = 3.
  2. Multiply inside the outer bracket: 3 × 2 = 6.
  3. Add: 3 + 6 = 9.
  4. Finish: 2 × 9 = 18.

A fraction bar acts like brackets. In (6 + 4) / (3 + 2) you evaluate the top and bottom first: 10 / 5 = 2.

A step-by-step evaluator

To see the order in action, here is a stand-in that rewrites an expression one small step at a time. It is a simplified teaching tool that only handles +, -, * and / on whole numbers without brackets, not a full calculator.

Python Watch the steps

Press Run (or Ctrl + Enter) to see the result here.

Program input · what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Each printed line is one step. Multiplication and division are cleared first, left to right, then addition and subtraction.

Common mistakes

  • Adding before multiplying. 5 + 2 × 3 is 11, not 21.
  • Ignoring left to right. 10 - 4 + 2 is 8, not 4.
  • Mishandling negative powers of a base. -3² means -(3²) = -9, while (-3)² = 9.
  • Forgetting that implied multiplication is still multiplication. 3(4 + 1) means 3 × 5 = 15.

When an expression looks tricky, add your own brackets to show the intended order. Extra brackets never hurt, and they make your work easier to read.

Check your understanding

Quick check · 4 questions

of 4 answered You scored / 4 · perfect!

  1. 1. What is 7 + 3 × 5?

    Multiply first: 3 × 5 = 15, then 7 + 15 = 22.
  2. 2. What is 36 ÷ 6 × 3?

    Division and multiplication are at the same level, so go left to right: 36 ÷ 6 = 6, then 6 × 3 = 18.
  3. 3. What is (4 + 2)² - 10?

    Brackets: 6. Power: 36. Subtract: 36 - 10 = 26.
  4. 4. What is -3² ?

    The power applies to 3 first, giving 9, and then the minus sign makes it -9.

Summary

  • The order is brackets, powers and roots, multiplication and division, then addition and subtraction.
  • Operations on the same level go left to right.
  • Brackets change the order; nested brackets start from the inside.
  • BODMAS and PEMDAS are two names for the same rule.
  • Add your own brackets whenever you want to be clear.

Next: Place Value