Order of Operations (PEMDAS) Explained With Examples

PEMDAS tells you which part of an expression to calculate first. Learn the rules, the left-to-right tie-breaker and the traps that cause most errors.

The order of operations is the agreed sequence for evaluating an expression: parentheses first, then exponents, then multiplication and division from left to right, then addition and subtraction from left to right. In the US this is remembered as PEMDAS. Using it, 8 + 2 × (7 − 3)² ÷ 4 = 16, and everyone who follows the rules gets the same answer.

Without a shared convention, 2 + 3 × 4 could be 20 or 14 depending on who calculated it. The order of operations settles it: multiplication comes first, so the answer is 14.

The PEMDAS rules

Step Operation Notes
1. P Parentheses and other grouping symbols Innermost group first; includes brackets, braces, fraction bars and radicals
2. E Exponents and roots Applied before any multiplication
3. MD Multiplication and division Same level: work left to right
4. AS Addition and subtraction Same level: work left to right

The acronym hides the most important detail. “MD” and “AS” are not four separate steps; they are two levels, each worked left to right. “Please Excuse My Dear Aunt Sally” makes it sound as if multiplication always beats division, and that misconception causes more wrong answers than anything else.

Other names for the same rules

  • BODMAS: Brackets, Orders, Division/Multiplication, Addition/Subtraction (UK, India, Australia)
  • BIDMAS: Brackets, Indices, Division/Multiplication, Addition/Subtraction (UK)
  • GEMDAS: Grouping, Exponents, Multiplication/Division, Addition/Subtraction (some US classrooms)

All of them describe identical rules.

A full worked example

Evaluate 8 + 2 × (7 − 3)² ÷ 4.

P: 7 − 3 = 4 → 8 + 2 × 4² ÷ 4

E: 4² = 16 → 8 + 2 × 16 ÷ 4

MD, left to right: 2 × 16 = 32, then 32 ÷ 4 = 8 → 8 + 8

AS: 8 + 8 = 16

Another: 5 + 3 × 2² − 8 ÷ 4.

Exponent: 2² = 4 → 5 + 3 × 4 − 8 ÷ 4

Multiplication and division, left to right: 3 × 4 = 12; 8 ÷ 4 = 2 → 5 + 12 − 2

Addition and subtraction, left to right: 17 − 2 = 15

The order of operations calculator shows each of these steps for any expression you enter.

Left to right matters

When operations share a level, the one on the left goes first. In general form:

a ÷ b × c = (a ÷ b) × c   ·   a − b + c = (a − b) + c

Division and multiplication:

24 ÷ 4 × 3 = 6 × 3 = 18   (not 24 ÷ 12 = 2)

Subtraction and addition:

10 − 4 + 3 = 6 + 3 = 9   (not 10 − 7 = 3)

A helpful way to see why: division is multiplication by a reciprocal, and subtraction is addition of a negative. Rewriting 24 ÷ 4 × 3 as 24 × ¼ × 3 and 10 − 4 + 3 as 10 + (−4) + 3 removes the ambiguity, because pure multiplication and pure addition can be done in any order.

Nested grouping symbols

Work from the innermost group outward. Brackets [ ] and braces { } are just larger parentheses.

3 × [12 − (2 + 4)² ÷ 9]

Innermost: 2 + 4 = 6 → 3 × [12 − 6² ÷ 9]

Inside the brackets: 6² = 36, 36 ÷ 9 = 4, 12 − 4 = 8 → 3 × 8 = 24

Fraction bars group too. In (4 + 8) over (2 × 3), evaluate the whole numerator and the whole denominator before dividing: 12 ÷ 6 = 2. When you type a fraction into a calculator on one line, you must add those parentheses yourself: (4+8)/(2*3). Typing 4+8/2*3 gives 4 + 12 = 16 instead.

Radicals group what is under them: √(9 + 16) = √25 = 5, not √9 + √16 = 7.

Traps with exponents and negatives

A negative sign is not part of the base unless parentheses say so.

−3² = −(3²) = −9   ·   (−3)² = 9

This matters constantly in algebra: if x = −3, then x² = 9, but −x² = −9.

Stacked exponents are evaluated from the top down. 232 means 2(3²) = 2⁹ = 512, not (2³)² = 64.

Spreadsheets break both rules. In Excel, the formula =-3^2 returns 9, because Excel applies the negation before the exponent, and =2^3^2 returns 64, because Excel evaluates exponents left to right. Add parentheses in spreadsheet formulas whenever a negative or a stacked exponent is involved.

The 6 ÷ 2(1+2) debate

This expression circulates online because people get two different answers.

  • Standard convention (answer 9): treat 2(1+2) as ordinary multiplication. Parentheses first gives 6 ÷ 2 × 3, then left to right: 3 × 3 = 9.
  • Implied multiplication first (answer 1): treat 2(1+2) as a single term, so 6 ÷ 6 = 1. Some textbooks, physics journals and older calculator models follow this convention for juxtaposed terms like 1/2x.

Neither camp is making an arithmetic mistake; they follow different conventions for an ambiguously written expression. The real lesson is to write clearly. Use a fraction bar, or add parentheses: (6 ÷ 2)(1 + 2) = 9 or 6 ÷ [2(1 + 2)] = 1.

Why calculators sometimes disagree

A basic four-function calculator usually applies each operation as soon as you press the next key. Type 2 + 3 × 4 = and it computes 2 + 3 = 5, then 5 × 4 = 20. A scientific calculator waits for the whole expression and applies PEMDAS, returning 14. Know which kind you are using; the site’s basic calculator keeps a paper-tape history so you can see exactly what was computed.

Common mistakes checklist

  • Doing all multiplication before any division (or all addition before any subtraction).
  • Forgetting that a fraction bar or square root groups everything under it.
  • Squaring a negative number without parentheses.
  • Dropping parentheses when moving from paper to a calculator or spreadsheet.
  • Distributing an exponent over a sum: (a + b)² is not a² + b². See exponent rules for the correct expansions.

Fractions follow the same order of operations; the fraction calculator and the exponent calculator apply it automatically.

Frequently asked questions

What does PEMDAS stand for?

Parentheses, Exponents, Multiplication and Division, Addition and Subtraction. Multiplication and division share one level and are done left to right, and so are addition and subtraction. The memory aid is 'Please Excuse My Dear Aunt Sally.'

Does multiplication always come before division?

No. Multiplication and division have equal priority and are worked from left to right. In 24 ÷ 4 × 3, divide first because it comes first: 6 × 3 = 18. Doing the multiplication first would wrongly give 2.

What is the answer to 6 ÷ 2(1+2)?

Under the standard convention, where implied multiplication has the same priority as written multiplication, the answer is 9: 6 ÷ 2 × 3 = 3 × 3 = 9. Some textbooks and calculators give implied multiplication higher priority and get 1. The expression is ambiguous, so it should be rewritten with more parentheses.

Is PEMDAS the same as BODMAS?

Yes. BODMAS (Brackets, Orders, Division and Multiplication, Addition and Subtraction) and BIDMAS (Indices) are the British and Commonwealth names for the same rules. The order of the letters D and M differs, but in every version they share one level and are applied left to right.

Why is −3² equal to −9 and not 9?

Exponents come before the negation, so −3² means −(3²) = −9. To square negative three, write the parentheses: (−3)² = 9.