Mathwords logoMathwords

Order of Operations (Precedence) — Definition, Formula & Examples

Order of operations is the set of rules that tells you which calculations to perform first when an expression has more than one operation. The standard order is Parentheses, Exponents, Multiplication and Division (left to right), then Addition and Subtraction (left to right), often remembered by the acronym PEMDAS.

Operator precedence is a convention that assigns a hierarchy to arithmetic and algebraic operations so that any well-formed numerical expression has exactly one value. Operations enclosed in grouping symbols are evaluated first, followed by exponentiation, then multiplication and division (processed left to right at equal precedence), and finally addition and subtraction (also processed left to right at equal precedence).

How It Works

When you see an expression like 3+4×23 + 4 \times 2, you need a rule to decide whether to add first or multiply first—different choices give different answers. The order of operations resolves this ambiguity. Start by simplifying anything inside parentheses or brackets, then evaluate exponents, then handle all multiplication and division from left to right, and finish with addition and subtraction from left to right. The mnemonic PEMDAS (Parentheses, Exponents, Multiplication, Division, Addition, Subtraction) helps you remember the sequence, but keep in mind that M and D share the same level, and A and S share the same level.

Worked Example

Problem: Evaluate: 6+2×(51)2÷46 + 2 \times (5 - 1)^2 \div 4
Parentheses: Simplify inside the parentheses first.
51=46+2×42÷45 - 1 = 4 \quad\Rightarrow\quad 6 + 2 \times 4^2 \div 4
Exponents: Evaluate the exponent next.
42=166+2×16÷44^2 = 16 \quad\Rightarrow\quad 6 + 2 \times 16 \div 4
Multiplication and Division (left to right): Multiply first (it appears to the left), then divide.
2×16=3232÷4=86+82 \times 16 = 32 \quad\Rightarrow\quad 32 \div 4 = 8 \quad\Rightarrow\quad 6 + 8
Addition: Finally, add.
6+8=146 + 8 = 14
Answer: 1414

Another Example

Problem: Evaluate: 18÷32+5×218 \div 3 - 2 + 5 \times 2
Multiplication and Division (left to right): Scan left to right for multiplication and division. First, 18÷318 \div 3, then 5×25 \times 2.
18÷3=6,5×2=1062+1018 \div 3 = 6, \quad 5 \times 2 = 10 \quad\Rightarrow\quad 6 - 2 + 10
Addition and Subtraction (left to right): Work left to right: subtract, then add.
62=4,4+10=146 - 2 = 4, \quad 4 + 10 = 14
Answer: 1414

Why It Matters

Every algebra, geometry, and science course depends on correctly evaluating expressions—one misplaced operation changes your answer entirely. Spreadsheet formulas, programming languages, and calculators all follow operator precedence rules modeled on the same convention. Mastering this skill now prevents errors in everything from solving equations in pre-algebra to writing code in a computer science class.

Common Mistakes

Mistake: Always doing multiplication before division (or addition before subtraction) because of the left-to-right order in PEMDAS.
Correction: M and D share the same precedence level; so do A and S. Evaluate whichever comes first when reading left to right. For 83+28 - 3 + 2, subtract first to get 55, then add to get 77.
Mistake: Forgetting to apply the exponent before multiplying when there are no parentheses, e.g., reading 3×233 \times 2^3 as (3×2)3(3 \times 2)^3.
Correction: Exponents bind more tightly than multiplication. Evaluate 23=82^3 = 8 first, then multiply: 3×8=243 \times 8 = 24, not 63=2166^3 = 216.

Related Terms

  • AlgebraUses order of operations to simplify expressions
  • ComputeEvaluating expressions requires correct precedence
  • CompositionNested functions follow an inside-out evaluation order
  • Additive Inverse of a NumberNegation interacts with precedence rules
  • Boolean LogicLogical operators have their own precedence hierarchy
  • Big O NotationOperator precedence matters in algorithm analysis expressions