PEMDAS and the order of operations
PEMDAS is the memory aid for the order of operations, the rules that say which part of a math problem to do first. It stands for Parentheses, Exponents, Multiplication and Division, Addition and Subtraction. Multiplication and division share one step and are done from left to right, and so are addition and subtraction.
What does PEMDAS stand for?
Each letter is one kind of operation, in the order you do them. Many students remember it with the sentence "Please Excuse My Dear Aunt Sally".
| Letter | Stands for | Means | Example |
|---|---|---|---|
| P | Parentheses | Do anything inside grouping symbols first: ( ), [ ], { } and fraction bars | (2 + 3) × 4 = 5 × 4 |
| E | Exponents | Powers and roots | 3² = 9, √16 = 4 |
| M D | Multiplication and Division | Whichever comes first, working left to right | 12 ÷ 3 × 2 = 4 × 2 |
| A S | Addition and Subtraction | Whichever comes first, working left to right | 10 − 4 + 3 = 6 + 3 |
Without one agreed order, 7 + 3 × 4 could be 40 or 19 depending on who worked it out. The order of operations makes it 19 for everyone: multiply first, then add. Under the Common Core standards used in many US states, grade 5 covers expressions with parentheses, brackets and braces, and grade 6 adds whole-number exponents.
The order of operations rules, step by step
- Parentheses and other grouping symbols. Work out what is inside them first. If they are nested, start with the innermost set.
- Exponents. Work out powers and roots.
- Multiplication and division, left to right. They have equal rank. Do whichever comes first as you read across.
- Addition and subtraction, left to right. They also have equal rank, so again work across from the left.
Why left to right matters
Look at 10 − 4 + 3. Working left to right gives 6 + 3 = 9. If you wrongly add first, you get 10 − 7 = 3. In the same way, 12 ÷ 3 × 2 is 4 × 2 = 8, not 12 ÷ 6 = 2. Thinking of subtraction as adding a negative helps: 10 − 4 + 3 is 10 + (−4) + 3, which is 9 in any order.
PEMDAS examples
These start easy and get harder. Cover the working and try each one first.
Example 1: multiplication before addition
Multiplication comes before addition, so the answer is 19. Add parentheses and the answer changes: (7 + 3) × 4 = 10 × 4 = 40.
Example 2: division and multiplication, left to right
No parentheses or exponents. Division comes first reading left to right, then multiplication, then subtraction:
The answer is 14.
Example 3: order of operations with exponents
The exponent goes first, so 3² = 9 before you multiply. The answer is 23. A common wrong answer is 5 + 6² = 41, which squares the 2 × 3.
Example 4: parentheses, exponents and all four operations
- Parentheses: 5 − 2 = 3, giving 18 ÷ 3 + 4² × 2.
- Exponents: 4² = 16, giving 18 ÷ 3 + 16 × 2.
- Multiplication and division, left to right: 18 ÷ 3 = 6 and 16 × 2 = 32, giving 6 + 32.
- Addition: 6 + 32 = 38.
Example 5: nested grouping symbols
Start with the innermost parentheses, then work outward through the brackets:
The answer is 24. A number right next to a bracket, like the 3 here, means multiply.
Example 6: a fraction bar is a grouping symbol
Treat the top and the bottom as if each were in parentheses. Top: 8 + 12 = 20. Bottom: 4 + 1 = 5. Then divide: 20 ÷ 5 = 4. If you type this into a calculator, put parentheses around the top and the bottom: (8 + 4 × 3) ÷ (2² + 1).
Negative numbers and exponents
An exponent applies only to what it is touching. In −3², the exponent belongs to the 3, so you square first and then apply the minus sign: −3² = −9. To square the negative number, it needs parentheses: (−3)² = 9.
Here x is the input and y is the output. Graphing software follows the order of operations too, so y = −x² means square x, then make it negative. Every output is zero or below, and the curve opens downward. At x = 2 the output is −4, not 4. If the minus sign were applied first, as in y = (−x)², every output would be positive and the curve would open upward.
Order of operations with variables
The same rules apply when you substitute numbers into an expression. Evaluate 2x² − 3x + 1 when x = 4:
Square the 4 before multiplying by 2, then work the subtraction and addition from left to right. Try one in the Algebra course: substitute the value and press Mark.
Evaluate a randomised expression for a given x.
Press Mark to have your answer marked in the Algebra course.
PEMDAS vs BODMAS, BIDMAS, BEDMAS and GEMDAS
Different countries use different memory aids, but they all describe the same order of operations.
| Name | Where it is used | Letters |
|---|---|---|
| PEMDAS | United States | Parentheses, Exponents, Multiplication and Division, Addition and Subtraction |
| BODMAS | UK, India, Australia and others | Brackets, Orders, Division and Multiplication, Addition and Subtraction |
| BIDMAS | UK | Brackets, Indices, Division and Multiplication, Addition and Subtraction |
| BEDMAS | Canada | Brackets, Exponents, Division and Multiplication, Addition and Subtraction |
| GEMDAS | Some US classrooms | Grouping symbols, Exponents, Multiplication and Division, Addition and Subtraction |
BODMAS puts D before M, and PEMDAS puts M before D, but that changes nothing, because division and multiplication are one step done left to right. GEMDAS says "grouping symbols" to remind you that brackets, braces and fraction bars count, not just parentheses.
What is the answer to 8 ÷ 2(2 + 2)?
This one goes viral every few years. Start with the parentheses: 2 + 2 = 4, giving 8 ÷ 2(4).
- Strict left to right: 8 ÷ 2 = 4, then 4 × 4 = 16. This is what PEMDAS gives when you follow it literally.
- Multiplication by juxtaposition first: some people, textbooks and calculators treat 2(4) as a single number because the 2 is written right against the parentheses. Then it is 8 ÷ 8 = 1.
Neither camp is foolish: the expression is ambiguous, and mathematicians avoid writing it. In a real problem you would write (8 ÷ 2)(2 + 2) = 16 or 8 ÷ [2(2 + 2)] = 1, or use a fraction bar, so that nobody has to guess. On a school test, follow PEMDAS strictly and the answer is 16.
Check your understanding with one more.
Common mistakes
- Doing all multiplication before any division. They have equal rank. Work left to right: 6 ÷ 2 × 3 = 3 × 3 = 9, not 1.
- Doing all addition before any subtraction. Same rule: 10 − 4 + 3 = 9, not 3.
- Squaring a product you have not worked out yet. In 2 × 3², only the 3 is squared, so it is 2 × 9 = 18, not 6² = 36.
- Losing the sign on a negative. −3² = −9, but (−3)² = 9.
- Ignoring the fraction bar. Work out the whole top and the whole bottom before dividing.
- Trusting a basic calculator. A simple four-function calculator often works each step as you type it, so 7 + 3 × 4 can show 40. Scientific and graphing calculators follow the order of operations.
- Stacked exponents. A tower like 2 to the 3 to the 2 is worked from the top down: 3² = 9 first, then 2⁹ = 512.
Practice problems
Work these out, then check your answers below.
- 9 + 6 ÷ 3
- (9 + 6) ÷ 3
- 4 × 5 − 3²
- 40 ÷ 5 × 2 + 1
- 2 + 3(7 − 2)²
- [15 − (2 + 1) × 4] × 6
Answers: 1) 11, 2) 5, 3) 11, 4) 17, 5) 77, 6) 18.
For more mixed practice, the daily Pre-Algebra & Algebra 1 paper is a short timed practice test of 8 questions, with a new one every day. You can also type any expression into the Equation Notepad to check your answer.
Common questions
What does PEMDAS stand for?
Do you multiply or divide first in PEMDAS?
Do you add or subtract first?
Is PEMDAS the same as BODMAS?
Where do square roots go in the order of operations?
Why do we need the order of operations?
What is 6 ÷ 2(1 + 2)?
Revision cards
Say the answer first, then flip the card to check it.
Where to go next
- Solve it
Equation Notepad
Write and evaluate equations with LaTeX rendering
Open the tool - Learn it
Algebra
Master equations, inequalities and the language of abstract mathematics
Start the course - Test it
Pre-Algebra & Algebra 1
A new exam-style paper every day, with instant marking and a mark scheme
Start today's paper