Topic · Arithmetic

Order of Operations

Once you have more than one operation in an expression, you need a rule for which one to do first — otherwise the same string of symbols gives different answers depending on who reads it. The rule is a convention, not a law of nature, but it's a convention with a reason: stronger operations bind tighter.

What you'll leave with

  • Why $2 + 3 \times 4$ has one right answer and not two — and why that one is $14$, not $20$.
  • The PEMDAS (a.k.a. BODMAS / BIDMAS) tiering: parentheses → exponents → multiplication & division → addition & subtraction.
  • The principle underneath the rule: operations bind more tightly the higher up the tier they sit.
  • Two subtleties most people miss: left-to-right within a tier, and the unary minus.

1. The ambiguity problem

Look at the expression $2 + 3 \times 4$ and ask a room full of people for its value. Half will say $20$ (they added $2 + 3 = 5$ first, then multiplied by $4$). The other half will say $14$ (they multiplied $3 \times 4 = 12$ first, then added $2$). They're both performing valid arithmetic — they just disagree on what the expression means.

There are only two ways out of this. Either you write parentheses everywhere — $(2 + (3 \times 4))$ — so that the order is forced explicitly, or you agree on a default order that everyone uses when parentheses are absent. Mathematics has overwhelmingly chosen the second route. The default order is what this topic is about.

Two things to keep in mind throughout:

  • The rule is a convention. There's no theorem that says multiplication "should" come before addition; the rule could in principle have gone the other way. But it didn't, and the worldwide consensus is real: every textbook, every calculator, every programming language obeys it.
  • Parentheses always win. Whatever the rule says about the default order, $(\,\ldots\,)$ overrides it. When in doubt, add parentheses — they cost nothing and they kill ambiguity dead.

2. The convention: PEMDAS

In the English-speaking world, the rule is usually memorized with the mnemonic PEMDAS — "Please Excuse My Dear Aunt Sally." In Britain and the Commonwealth it's BODMAS or BIDMAS. The letters are different but the rule is the same:

1
Parentheses (or Brackets)
Anything grouped inside ( ) or [ ] is evaluated first.
2
Exponents (or Orders / Indices)
Powers and roots, like $3^2$ or $\sqrt{9}$.
3
Multiplication & Division
Same tier — evaluated left to right.
4
Addition & Subtraction
Same tier — evaluated left to right.

Two things make this list less innocent than it looks:

  • Multiplication and division occupy the same tier; they're not two separate steps. When both appear, work left to right. Same for addition and subtraction.
  • The mnemonic PEMDAS lists "M" before "D" and "A" before "S" purely because PEMDAS is easier to say than PEDMAS or PEDMSA. It does not mean multiplication beats division. This is the single most common misreading of the rule.

Applied to the opening puzzle: $2 + 3 \times 4$. There are no parentheses or exponents. Multiplication (tier 3) is more tightly bound than addition (tier 4), so we do the multiplication first: $3 \times 4 = 12$, and the expression becomes $2 + 12 = 14$. That is the universally agreed answer.

3. Playground: step through an expression

Click through one operation at a time. Each step highlights the piece being evaluated and shows what the expression looks like afterwards. The point is to see the rule act locally — each step touches one chunk of the expression, replaces it with a number, and leaves the rest alone.

2 + 3 × (4 − 1)² ÷ 3
Click Next to begin evaluating.

4. Why this order — the principle

You can memorize PEMDAS as raw rule, or you can see the pattern that makes it the natural order. The pattern is short:

Each operation is a compressed version of the one below it. Stronger compression binds tighter.

Walk up the ladder:

  • Multiplication is repeated addition. $3 \times 4$ is shorthand for $4 + 4 + 4$. Multiplication is the "compressed" form of addition.
  • Exponentiation is repeated multiplication. $3^4$ is shorthand for $3 \times 3 \times 3 \times 3$. Exponentiation is the compressed form of multiplication.

The convention says: do the most-compressed operation first, then unfold one level at a time. When you read $2 + 3 \times 4$, the $\times 4$ is hugging the $3$ — it's a single compact unit that means "three fours." That unit should resolve before the looser $+$ tries to combine it with the $2$.

The same logic explains why exponents come before multiplication. In $2 \times 3^2$, the $3^2$ is the tightest unit; it resolves to $9$ first, and then the $2 \times 9$ happens. Subtraction inherits its tier from addition (it's just adding a negative); division inherits its tier from multiplication (it's just multiplying by a reciprocal) — which is also why each pair lives on the same tier rather than two adjacent ones.

Memorize the ladder, not the mnemonic

If you internalize that exponents are compressed multiplication and multiplication is compressed addition, you can recover PEMDAS at any time, and you won't fall for the M-beats-D trap. The mnemonic is a crutch; the ladder is the actual rule.

5. Subtleties that catch people out

Left-to-right within a tier

When the same tier appears more than once, work left to right. The classic gotcha is $8 \div 2 \times 4$:

  • Reading left to right: $8 \div 2 = 4$, then $4 \times 4 = 16$.
  • Reading "M before D": $2 \times 4 = 8$, then $8 \div 8 = 1$. Wrong.

The convention is left-to-right, so the answer is $16$. Anyone who tells you "$1$" has been bitten by the PEMDAS-mnemonic-as-strict-ranking misreading.

The unary minus and exponents

This one is genuinely confusing because it looks like an exception even though it isn't. Compare:

  • $-3^2 = -(3^2) = -9$. The exponent binds tighter than the negation, so it acts on the $3$ first, and the negation takes the result.
  • $(-3)^2 = 9$. The parentheses force the negation to apply before the squaring, so we're squaring a negative number, which gives a positive.

The takeaway: in $-3^2$, the minus sign is not part of the base. If you want it to be, you have to say so with parentheses. Many calculators get this wrong, and most spreadsheet programs disagree on the convention — yet another reason to lean on explicit parentheses when the stakes are real.

Implicit multiplication

When you write $2(3+1)$ or $2x$, the multiplication is implicit — there's no $\times$ symbol. Strictly by PEMDAS, implicit multiplication should sit at the multiplication tier, no different from $2 \times (3+1)$. In practice, some mathematicians and some calculators treat implicit multiplication as binding tighter than ordinary multiplication or division. That's the source of the periodic viral debate over expressions like $6 \div 2(1+2)$, which gives $9$ under the strict convention and $1$ under the "implicit multiplication binds tighter" reading.

The honest answer is that this case is genuinely ambiguous in the wild — the standard rules don't all agree. Working mathematicians avoid the problem by writing the expression as $\tfrac{6}{2(1+2)}$ or $\tfrac{6}{2} \cdot (1+2)$ — whichever they actually mean — and never relying on the reader to guess.

When in doubt, parenthesize

Every expression that has been the subject of a viral internet debate could have been disambiguated by two well-placed parentheses. If you're writing for someone else to read, write the parentheses. The "savings" of leaving them out is illusory — what you've saved in ink, you've spent in misunderstanding.

6. Common pitfalls

"M before D" / "A before S"

The mnemonic letters are arbitrary. Multiplication and division share a tier; so do addition and subtraction. Within a tier, the rule is left-to-right. $8 \div 2 \times 4 = 16$, not $1$.

Treating the unary minus like a binary operator

In $-3^2$, the squaring happens first, then the negation — the answer is $-9$. To square a negative number, you must wrap it in parentheses: $(-3)^2 = 9$. This shows up in physics and statistics formulas constantly; mis-parenthesizing it is one of the most common silent errors in spreadsheets.

"Distributing" the minus across parens

$5 - (3 + 2)$ equals $5 - 5 = 0$, not $5 - 3 + 2 = 4$. When you remove the parentheses, you must flip the sign of every term inside, not just the first one. This is technically a sign-rules issue rather than an order-of-operations one, but the two get tangled together in practice.

Trusting calculators on edge cases

Different calculators disagree on implicit multiplication, on the unary minus before exponents, and on a handful of other corner cases. Two calculators evaluating the same string can give different answers — both technically correct under their own conventions. The fix isn't to find "the right" calculator; it's to write expressions that can't be misread by any reasonable convention.

7. Worked examples

Try each before opening the solution.

Example 1 · $2 + 3 \times 4$

No parentheses, no exponents. Multiplication (tier 3) binds tighter than addition (tier 4):

$$ 2 + (3 \times 4) = 2 + 12 = 14. $$

Answer: $\boxed{14}$.

Example 2 · $20 - 4 \times 3 + 2$

Tier 3 first: $4 \times 3 = 12$. The expression becomes $20 - 12 + 2$.

Tier 4 left to right: $20 - 12 = 8$, then $8 + 2 = 10$.

Answer: $\boxed{10}$. A common slip is to compute the subtraction last because "A comes before S" — that would give $20 - 14 = 6$, which is wrong.

Example 3 · $(8 - 3)^2 \div 5$

Parentheses first: $8 - 3 = 5$. Expression becomes $5^2 \div 5$.

Exponent next: $5^2 = 25$. Expression becomes $25 \div 5$.

Division: $25 \div 5 = 5$.

Answer: $\boxed{5}$.

Example 4 · $8 \div 2 \times 4$ — left-to-right gotcha

$\div$ and $\times$ live on the same tier. Work left to right.

First: $8 \div 2 = 4$.

Then: $4 \times 4 = 16$.

Answer: $\boxed{16}$. Anyone arriving at $1$ has done multiplication first and division second — but that violates the left-to-right rule for same-tier operations.

Example 5 · $-3^2 + (-3)^2$

The two terms look similar but parse differently.

First term: $-3^2$. The exponent binds tighter than the unary minus, so this is $-(3^2) = -9$.

Second term: $(-3)^2$. The parentheses make the negation part of the base, so we're squaring $-3$: $(-3) \times (-3) = 9$.

Sum: $-9 + 9 = 0$.

Answer: $\boxed{0}$. If you got $18$ instead, you treated both terms the same — almost certainly squaring the negative in both. This is a common source of silent errors in physics formulas like $-v^2$ versus $(-v)^2$.

Sources & further reading

The order-of-operations convention is universal, but the framing — that the tiers reflect compressed-ness rather than alphabetical ordering — is borrowed from a few careful expositions. Here are the most useful.

Test your understanding

A quiz that builds from easy to hard. Pick an answer to get instant feedback and a worked explanation. Your progress is saved in this browser — come back anytime to continue.

Question 1 of 22
0 correct