Order of Operations (PEMDAS) Explained
The order of operations tells you which part of an expression to calculate first. Learn what PEMDAS really means, why multiplication and division share a rank, and how to avoid the most common mistakes.
What you'll learn
- The order of operations and what each letter of PEMDAS stands for
- Why multiplication and division are done together, from left to right
- How grouping symbols like brackets and fraction bars change the order
- How to evaluate multi-step expressions correctly
Introduction
The order of operations is the agreed-upon rule for which part of a math expression to calculate first. Without it, an expression like could mean 35 or 23 depending on who calculated it. With it, everyone gets 23.
Why this matters
An expression is only useful if it has one meaning. Calculators, spreadsheets, and programming languages all follow the order of operations, so you need to know it to predict what they'll do with what you type. It's also the foundation of algebra. Simplifying an expression like correctly depends entirely on doing the steps in the right order.
The concept
The order
Definition — Order of operations
Evaluate an expression in this order:
- Grouping symbols such as parentheses, working from the innermost group outward
- Exponents
- Multiplication and division, together, from left to right
- Addition and subtraction, together, from left to right
In the United States this is often remembered as PEMDAS: Parentheses, Exponents, Multiplication, Division, Addition, Subtraction. Other countries use BODMAS or BIDMAS (B for brackets, O for orders or I for indices). They all describe the same rule.
Multiplication and division share a rank
PEMDAS lists M before D, but that's only because a word has to put one letter first. Multiplication and division have equal priority. You do whichever comes first, reading left to right. The same is true for addition and subtraction.
Example — Left to right matters
Dividing first, because it comes first from the left, gives 16. Doing the multiplication first would give , which is wrong.
Subtracting first gives 9. Adding first would give , which is also wrong.
Grouping symbols come in many forms
Parentheses are the most familiar grouping symbol, but they aren't the only one. All of these group whatever is inside them and are evaluated first:
- Parentheses , brackets , and braces
- A fraction bar: the whole numerator and the whole denominator are each a group
- Absolute value bars and square root symbols
Example — A fraction bar acts like parentheses
The fraction bar means . Both sums are worked out before dividing.
Worked examples
Example — Worked example 1: multiplication before addition
Problem: Evaluate .
Step 1: There are no grouping symbols or exponents. Multiplication comes before addition: .
Step 2: .
Answer: 23
Compare this with , where the parentheses force the addition first: .
Example — Worked example 2: an exponent with multiplication
Problem: Evaluate .
Step 1: The exponent applies only to the 3: .
Step 2: .
Answer: 18. A common error is to compute first and then square it to get 36.
Example — Worked example 3: every step
Problem: Evaluate .
Step 1 (grouping): , so the expression is .
Step 2 (exponent): , so it's .
Step 3 (multiply and divide, left to right): , then . That leaves .
Step 4 (subtract): .
Answer: 8
Example — Worked example 4: nested grouping
Problem: Evaluate .
Step 1: Start with the innermost group: . The expression becomes .
Step 2: Inside the brackets, multiply before adding: , then .
Step 3: .
Answer: 28
Common mistakes
Warning — Always multiplying before dividing
Because M comes before D in PEMDAS, it's easy to think multiplication always goes first. It doesn't.
Working left to right gives 8. Multiplying first would give , which is wrong.
Warning — Always adding before subtracting
The answer is 12, not 8. Addition and subtraction share a rank, so go left to right.
Warning — Squaring a negative number
and are different. The exponent is applied before the negative sign unless parentheses say otherwise:
Many calculators follow this rule too, so type the parentheses when you mean to square a negative number.
Note — About those viral math problems
Expressions like go viral because people get different answers. Under the strict left-to-right rule, it's . However, some textbooks and calculators give multiplication written by placing things side by side higher priority, which gives 1. The real lesson is that the expression is written ambiguously. Mathematicians avoid the problem by writing or , which leave no doubt.
Practice questions
-
Evaluate .
Show answer
- Multiply first: . Then .
-
Evaluate .
Show answer
- The parentheses give . The exponent gives . Then .
-
Evaluate .
Show answer
- Divide and multiply from left to right: , then . Now add and subtract from left to right: , then .
-
Evaluate .
Show answer
- Innermost first: , and . The fraction is . Inside the brackets, . Then , and finally .
Summary
- Evaluate grouping symbols first, then exponents, then multiplication and division, then addition and subtraction.
- Multiplication and division have equal priority. So do addition and subtraction. Within each pair, work from left to right.
- Fraction bars, brackets, absolute value bars, and square roots all act as grouping symbols.
- An exponent applies only to what it's directly attached to, so but .
To practice with instant feedback, try the order of operations lesson in the Grade 5 curriculum.