Try this: what is 6 + 2 × 3? If you add first, you get 24. If you multiply first, you get 12. Only one of those answers is right, and the rule that decides which is called the order of operations. It is one of the first things taught in algebra, and it is also one of the most common sources of mistakes, from homework to spreadsheet formulas. This guide explains the rule, the memory tricks, the tricky cases and how to check your work.
What Is the Order of Operations?
The order of operations is an agreed set of rules that tells you which part of a calculation to do first. Without it, the same expression could produce different answers depending on who calculated it. The rules guarantee that everyone gets the same result from the same expression.
The Order: PEMDAS and BODMAS
Two acronyms describe the same rules:
- PEMDAS: Parentheses, Exponents, Multiplication and Division, Addition and Subtraction (common in the United States).
- BODMAS: Brackets, Orders, Division and Multiplication, Addition and Subtraction (common in the UK and many other countries).
"Orders" in BODMAS means exponents and roots. Both mean:
- Parentheses (brackets) first. Work out everything inside, starting from the innermost pair.
- Exponents (orders) next. Powers and roots, such as 3² or √16.
- Multiplication and division together, from left to right.
- Addition and subtraction together, from left to right.

The Part People Forget: Left to Right
The letters in PEMDAS can mislead. Multiplication does not always come before division, and addition does not always come before subtraction. Each pair has the same rank, and you handle whichever comes first when reading from left to right.
- 12 ÷ 3 × 2: divide first (12 ÷ 3 = 4), then multiply (4 × 2 = 8). If you multiplied first, you would get 12 ÷ 6 = 2, which is wrong.
- 5 − 2 + 1: subtract first (5 − 2 = 3), then add (3 + 1 = 4). Adding first would give 5 − 3 = 2, which is wrong.
Simple Examples
- 6 + 2 × 3 = 6 + 6 = 12 (multiplication before addition)
- (6 + 2) × 3 = 8 × 3 = 24 (parentheses change the order)
- 2 + 3² × 4 = 2 + 9 × 4 = 2 + 36 = 38 (exponent, then multiplication, then addition)
A Longer Example, Step by Step
Calculate 20 − 4 × (3 + 2)² ÷ 10.
- Parentheses: 3 + 2 = 5, so the expression becomes 20 − 4 × 5² ÷ 10.
- Exponent: 5² = 25, giving 20 − 4 × 25 ÷ 10.
- Multiplication and division, left to right: 4 × 25 = 100, then 100 ÷ 10 = 10, giving 20 − 10.
- Subtraction: 20 − 10 = 10.

Negative Numbers and Exponents
A common trap involves a minus sign and a power:
- −3² means "negative of 3 squared", which is −(3 × 3) = −9.
- (−3)² means "negative 3, squared", which is (−3) × (−3) = 9.
The parentheses decide whether the minus sign is part of the number being squared. Calculators handle this differently, so enter the parentheses when you mean them.
The Viral Problems
Every few years a puzzle such as 8 ÷ 2 × (2 + 2) goes viral, and people argue about the answer. Follow the rules: parentheses first gives 8 ÷ 2 × 4. Then divide and multiply from left to right: 8 ÷ 2 = 4, and 4 × 4 = 16.
The real argument starts with an expression like 6 ÷ 2(1 + 2), where a number is written right next to a bracket with no multiplication sign. Some textbooks and calculators treat this "implied multiplication" as binding more tightly, giving 6 ÷ (2 × 3) = 1, while the strict left-to-right reading gives 3 × 3 = 9. The expression is ambiguous, and different conventions disagree. The practical fix is simple: if you are writing a formula for someone else, add parentheses to make the intent clear.
Nested Parentheses
When parentheses sit inside other parentheses, start with the innermost pair and work outward. For example, 2 × (3 + (4 − 1)²):
- Innermost: 4 − 1 = 3, so the expression becomes 2 × (3 + 3²).
- Exponent: 3² = 9, giving 2 × (3 + 9).
- Parentheses: 3 + 9 = 12, giving 2 × 12.
- Multiplication: 24.
Some people use square brackets or braces for the outer layers, for example 2 × [3 + (4 − 1)²], purely to make the nesting easier to read. They work the same way.
Fractions and Roots
A fraction bar acts like a pair of parentheses around the top and the bottom. In (3 + 5) / (2 + 2), you work out the numerator and denominator separately, then divide: 8 / 4 = 2. A root sign also groups what is under it. For √(9 + 16), add first: √25 = 5. This is different from √9 + √16 = 3 + 4 = 7.
Order of Operations in Spreadsheets and Code
Spreadsheets and programming languages follow the same rules, with a few details worth knowing. In Excel, for example, a minus sign in front of a number can bind more tightly than an exponent, so −3^2 may return 9, not −9. Languages such as Python do it the mathematical way and return −9. When you are unsure, use parentheses. They cost nothing and remove doubt.
Common Mistakes
- Doing operations strictly in the order of the letters. Multiplication and division share a rank, as do addition and subtraction.
- Forgetting to go left to right within the same rank.
- Ignoring parentheses around negative numbers. −3² and (−3)² differ.
- Adding before multiplying because the addition comes first in the line.
- Trusting a calculator without checking. Different calculators may treat implied multiplication differently.
A Checking Habit
When you finish, estimate the answer in your head. In 6 + 2 × 3, you know the multiplication gives 6, and 6 + 6 should be near 12, not 24. If your result is far from your estimate, go back and check the order of your steps.
Calculate It Online
Our scientific calculator evaluates full expressions with parentheses and exponents, so you can check your own work step by step. For simple operations, the multiplication calculator and the exponent calculator are useful for verifying single parts.
Frequently Asked Questions
Is PEMDAS the same as BODMAS?
Yes. They describe the same rules with different words. Brackets are parentheses, and orders are exponents.
Does multiplication always come before division?
No. They have equal rank, and you work from left to right.
Why are there rules at all?
So that every expression has exactly one correct value, no matter who calculates it.
What if my calculator gives a different answer?
Check how you typed it. Missing parentheses and implied multiplication are the usual causes. Enter the expression with explicit brackets and a multiplication sign.