Order of Operations
Evaluate grouped expressions without changing their meaning.
Arithmetic is the math of counting, sharing, and comparing amounts. It covers the four operations plus fractions, decimals, percents, and ratios.
Order of Operations: the central idea
Order of operations is a reading convention that makes an unambiguous expression produce the same value for every reader.
Words you need
- Order of operations
- The order of operations is the agreed sequence, grouping then exponents then multiplication and division then addition and subtraction, that makes every reader get the same value from the same expression.
- PEMDAS
- PEMDAS is the memory word for Parentheses, Exponents, Multiplication and Division, Addition and Subtraction, and its MD and its AS each count as a single shared level.
- Grouping symbol
- A grouping symbol is anything that fences off a piece of an expression to be finished first, including parentheses, square brackets, a fraction bar, a radical sign, and absolute-value bars.
- Term
- A term is a chunk of an expression separated from its neighbors by a plus or minus sign, so $5+72\div4-7$ contains the three terms 5, $72\div4$, and 7.
- Base and exponent
- In $6^2$ the base is 6 and the exponent is 2, and the exponent applies only to whatever sits directly to its left.
- Nested parentheses
- Nested parentheses are grouping symbols placed inside other grouping symbols, and the innermost pair is always simplified first.
What to know before this lesson
Know arithmetic facts, signed numbers, fraction bars, and how grouping symbols define a single expression.
If one of those prerequisites is uncertain, use the Arithmetic subject guide to locate the earlier concept before memorizing a procedure.
Order of operations: a worked example
Every step, with the arithmetic
- Step 1 - Write the expression$5+2(9-3)^2\div4-7$
- Step 2 - Do the parentheses first$9-3=6$, leaving $5+2(6)^2\div4-7$
- Step 3 - Do the exponent next$6^2=36$, leaving $5+2(36)\div4-7$
- Step 4 - Multiply and divide left to right, so multiply first$2\times36=72$, leaving $5+72\div4-7$
- Step 5 - Now the division, still moving left to right$72\div4=18$, leaving $5+18-7$
- Step 6 - Add and subtract left to right$5+18=23$, leaving $23-7$
- Step 7 - Finish$23-7=16$
$18\div3\times2$ has two equal-priority operations. Reading left to right gives $6\times2=12$, not $18\div6$.
The priority levels, in order, with the traps at each one
| Level | Operations | Direction | Example | Correct value |
|---|---|---|---|---|
| 1 | Grouping: parentheses, brackets, fraction bar, radical, absolute value | Innermost group first | 2(3 + 4) | 2(7) = 14, not 6 + 4 |
| 2 | Exponents and roots | Stacked powers go right to left | 2^3^2 | 2^9 = 512, not 8^2 = 64 |
| 3 | Multiplication and division (one shared level) | Left to right | 18 / 3 x 2 | 6 x 2 = 12, not 18 / 6 = 3 |
| 4 | Addition and subtraction (one shared level) | Left to right | 10 - 4 + 3 | 6 + 3 = 9, not 10 - 7 = 3 |
| Special case | A minus sign written in front of a power | The exponent acts before the minus sign | -3^2 against (-3)^2 | -9 against 9 |
The step-by-step method for order of operations
- Simplify grouping symbols from the inside outward, treating fraction bars and radicals as grouping.
- Evaluate powers and roots before multiplication or division.
- Perform multiplication and division left to right, then addition and subtraction left to right.
How to check your answer
Re-evaluate the expression with explicit parentheses around each completed step and compare with a calculator entered in one line.
Use rounding, inverse operations, and benchmark fractions such as one-half or one-quarter to verify the sign and size of the answer.
A mistake that changes the mathematics
PEMDAS does not mean multiplication always precedes division or addition always precedes subtraction. Each pair shares one priority level.
Explain why the tempting step is invalid, then write the condition or definition that prevents it. This turns the error into a rule you can recognize in a new problem.
Where you will actually use this
Spreadsheet formulas
A spreadsheet follows the same rules you do. Typing =3*4.50+2*6 returns 25.50 because each multiplication happens before the addition. If you wanted the sum first you would have to type =3*(4.50+2)*6, which returns a completely different 117.
Writing code
In Python, 5 + 2 * 3 ** 2 evaluates to 23, because the power runs first to give 9, then $2\times9=18$, then the addition. Programming languages inherit PEMDAS almost exactly, which is why a missing pair of parentheses is such a common bug.
Checking a shared bill
Three shirts at 12 dollars each plus 8 dollars of shipping, split between two people, is $(3\times12+8)\div2=44\div2=22$ dollars each. Dropping the parentheses gives $3\times12+8\div2=40$, which is not the price of anything.
How order of operations connects to the rest of arithmetic
- Fractions — The fraction bar groups everything above it and everything below it, so $\dfrac{3+9}{2+4}$ is $\tfrac{12}{6}=2$, not $3+\tfrac92+4$.
- Solving linear equations — Solving runs this order in reverse: you undo addition and subtraction first and undo the multiplication last, which is why $3x-5=16$ starts with adding 5.
- The quadratic formula — The formula's fraction bar groups all of $-b\pm\sqrt{b^2-4ac}$ over $2a$, and the students who divide only part of the top are making an order-of-operations error.
Try a transfer problem
Evaluate $24-3[2^2+8\div(6-4)]$ and annotate which grouping controls each step.
Show the worked answer
Work from the innermost grouping outward. First the parentheses: $6-4=2$, so the expression is $24-3[2^2+8\div2]$. Next the exponent inside the brackets: $2^2=4$, giving $24-3[4+8\div2]$. Still inside the brackets, division outranks addition: $8\div2=4$, giving $24-3[4+4]=24-3[8]$. The brackets are now finished, so multiply: $3\times8=24$, giving $24-24$. Finally subtract: the answer is 0. The grouping controls everything here. The parentheses had to close before the exponent could be evaluated, and the brackets had to close before the 3 could multiply anything.
Once you have an answer, check it with the arithmetic calculator. Work the problem yourself first: the calculator confirms the arithmetic, but choosing the method is the part that transfers to the next question.
Work without copying the example. When finished, use the relevant focused calculator or formula reference to check the setup and result, then correct the first line where your reasoning changed. When the method feels reliable, move to arithmetic practice questions.
Questions about order of operations
Is PEMDAS or BODMAS correct?
Both, because they are the same rule with different names. BODMAS says Brackets, Orders, Division and Multiplication, Addition and Subtraction. Orders means exponents and roots, and brackets means parentheses. Even though BODMAS lists division first, division and multiplication still share one level and are still done left to right.
What is the answer to 8 / 2(2 + 2)?
Reading strictly left to right after the parentheses gives $8\div2\times4=4\times4=16$. People who answer 1 are treating the implied multiplication in 2(4) as tighter than the division, a convention some older textbooks used. Neither side is being foolish; the expression is simply written badly. Real mathematical writing uses a fraction bar or extra parentheses so the question never comes up.
Why is $-3^2$ equal to $-9$?
Because the exponent grabs only the 3, and the minus sign is applied afterward, so it reads as the opposite of $3^2$, which is $-9$. Putting the negative inside the parentheses changes the base: $(-3)^2=(-3)(-3)=9$. Calculators follow the same rule, which surprises a lot of people.
Does a fraction bar change the order?
It acts as a grouping symbol on both the top and the bottom, so you finish each one separately before dividing. In $\dfrac{3+9}{2+4}$ the top becomes 12 and the bottom becomes 6, so the value is 2. Typed on one line it must be written (3+9)/(2+4), because 3+9/2+4 evaluates to 11.5 instead.