Order of Operations

In mathematics, operations refer to actions like addition, subtraction, multiplication, division, and exponentiation. The same expression can produce different results depending on the order in which these operations are performed. The order of operations is a set of conventions that specifies a single, unambiguous evaluation order, ensuring that every mathematician and every calculator reads an expression the same way.

Quick Reference: The Rules

Priority Operation Notes

  1. Parentheses (brackets) Innermost first
  2. Exponentiation Right to left for stacked powers
  3. Multiplication and Division Left to right, equal priority
  4. Addition and Subtraction Left to right, equal priority

The Four Rules (PEMDAS)

The order of operations is captured by the mnemonic PEMDAS:

PEMDAS:

  • Parentheses
  • Exponents
  • Multiplication & Division
  • Addition & Subtraction

A common memory phrase is "Please Excuse My Dear Aunt Sally." The four levels, in order of priority, are explained below.

Rule 1: Parentheses

Evaluate all expressions inside grouping symbols first, starting with the innermost group and working outward. Grouping symbols are the override mechanism: they always take priority, regardless of any other rule.

The P in PEMDAS stands for parentheses ( ), but the same rule applies to all three types of grouping symbol:

Symbol Name Typical use ( ) Parentheses Primary grouping [ ] Brackets (square brackets) Grouping inside parentheses to improve readability { } Curly braces (braces) Outermost grouping when brackets are already in use

When expressions are nested, the convention in textbooks and handwriting is to alternate symbols from inside out (parentheses innermost, then brackets, then curly braces) so that the eye can easily match each opening symbol to its closing partner:

Mathematically all three symbols mean exactly the same thing: evaluate the enclosed expression first. The alternation is a readability convention, not a rule that changes priority.

A basic example without nesting:

Rule 2: Exponentiation

Apply exponents (powers and roots) before multiplication, division, addition, or subtraction.

Rule 3: Multiplication and Division (left to right)

Multiplication and division have equal priority and are evaluated strictly left to right.

Rule 4: Addition and Subtraction (left to right)

Addition and subtraction have equal priority and are evaluated strictly left to right.

Why This Order? The Motivation Behind the Rules

The order of operations is a convention, not a mathematical law, but it is a well-motivated one. Each level of priority reflects how algebraic notation naturally groups quantities.

Why multiplication before addition? In algebra, writing means , never . The product is a single entity (a term), and terms are added together to form an expression. This intuition, embedded in algebraic notation since the 17th century, is why multiplication binds more tightly than addition.

Why exponentiation before multiplication? Similarly, means , not . The exponent belongs to the base immediately below it. If multiplication had higher priority than exponentiation, standard polynomial notation would be unreadable.

Why left to right for equal-priority operations? This is a pure convention, consistent with the left-to-right direction of written language. It resolves ambiguity when two operations of equal strength appear in sequence.

Historical note. The rules were progressively formalized through the 16th–19th centuries as algebraic notation developed. The convention that multiplication precedes addition was implicit in Leibniz and Euler's notation. The explicit term "order of operations" and the classroom mnemonics (PEMDAS, BODMAS) were largely codified by textbook authors in the late 19th century, as mass-printed mathematics textbooks became widespread.

Worked Examples

Example 1.

Example 1. Evaluate .

Multiplication before addition:

Example 2.

Example 2. Evaluate .

Division and multiplication left to right:

Example 3.

Example 3. Evaluate .

Parentheses → exponent → multiplication → addition/subtraction left to right:

Example 4.

Example 4. Evaluate .

The fraction bar acts as an implicit parenthesis around the numerator and denominator:

Why Mnemonics Can Mislead

Mnemonic acronyms are useful memory aids, but they obscure two critical facts that are not spelled out by the letters themselves.

Pitfall 1: M and D are equal, not sequential. Because "M" appears before "D" in PEMDAS, many students conclude that multiplication is always performed before division. This is wrong. Multiplication and division share the same priority level and are evaluated left to right. Applying multiplication first gives incorrect results:

Pitfall 2: A and S are equal, not sequential. Similarly, "A" before "S" does not mean addition is always done first. Addition and subtraction share equal priority and run left to right:

Understanding the two-tier structure (multiplication and division together at level 3; addition and subtraction together at level 4) matters far more than remembering the letters.

Special Cases and Exceptions

Stacked Exponentiation (right to left)

When exponents are written as a tower (stacked superscripts), the convention is to evaluate from the top down, that is, right to left:

This convention is both standard and natural: evaluating left to right would give , which is just a single exponent and makes the tower notation pointless. For example:

Implied Multiplication (Juxtaposition)

When multiplication is indicated by placing two quantities side by side, without any multiplication symbol, it is called implied multiplication or multiplication by juxtaposition. In academic and scientific writing, juxtaposition is conventionally given higher priority than explicit multiplication or division, because the two factors form a visual unit.

Under this convention, is read as , not as , and means .

This convention is not universal, however, and is a common source of confusion:

  • Many scientific calculators (TI-83, most HP models) treat as , giving priority to left-to-right division.
  • The TI-82 and some others do give juxtaposition higher priority.
  • Google and Wolfram Alpha follow strict left-to-right PEMDAS with no special treatment for juxtaposition.

Because of this disagreement, expressions like should always be avoided in writing. Use explicit parentheses, such as or , to remove any ambiguity.

Unary Minus

The minus sign can be either binary (between two numbers, meaning subtraction) or unary (in front of one number, meaning negation). The unary minus is generally treated as having lower priority than exponentiation, so:

When negating the base is intended, explicit parentheses are required.

Ambiguous Expressions: The Viral Math Problem

In 2019, the expression went viral online, with people arriving at two different answers:

  • Answer 16: Treat as , then apply left-to-right PEMDAS: .
  • Answer 1: Treat as an implied-multiplication unit with higher priority: .

Both answers follow a consistent rule; they just follow different rules. The expression is genuinely ambiguous, and the disagreement it caused illustrates why professional mathematicians and scientists avoid this style of writing entirely. The American Mathematical Society commented that the problem is "ambiguous as written."

The correct takeaway is not which answer is right, but that a well-written expression leaves no room for ambiguity. The two unambiguous ways to write this problem are:

International Variants

PEMDAS is the standard mnemonic in the United States. Other English-speaking countries use different acronyms for the same rules:

Acronym Stands for Used in BODMAS Brackets, Order, Division/Multiplication, Addition/Subtraction UK, India, Australia BEDMAS Brackets, Exponents, Division/Multiplication, Addition/Subtraction Canada, New Zealand BIDMAS Brackets, Indices, Division/Multiplication, Addition/Subtraction UK (alternative)

Despite the different names, the mathematical rules are identical. The differences are purely linguistic (parentheses vs. brackets, exponents vs. orders vs. indices), reflecting regional English vocabulary rather than different mathematics.

Frequently Asked Questions

Does PEMDAS mean multiplication always comes before division? No. "MD" in PEMDAS is a single level: multiplication and division have equal priority and are evaluated left to right. The letters M and D appear in that order only because "PEDMAS" is harder to pronounce. Whenever division appears to the left of multiplication, division is performed first.
Is PEMDAS the same as BODMAS? Yes, they describe the same rules. PEMDAS is standard in the United States; BODMAS, BEDMAS, and BIDMAS are used in the UK, Canada, Australia, and other Commonwealth countries. The differences are purely in the English words chosen: *parentheses* vs. brackets, exponents vs. orders vs. indices. The mathematical priority hierarchy is identical everywhere. See the [International Variants](#sec:international-variants) section for details.
What does the fraction bar do in the order of operations? A fraction bar (vinculum) acts as an implicit parenthesis around both the numerator and the denominator. The entire numerator is evaluated first, the entire denominator is evaluated first, and then the division is performed. So , not .
What is the correct answer to ? The expression is ambiguous. Applying strict left-to-right PEMDAS (treating as ) gives . Applying the convention that juxtaposition has higher priority than division gives . Both are defensible under different conventions. In professional mathematical writing, such expressions are never used; the author would write either or to make the intent clear.
Is equal to or ? It equals . By convention, exponentiation has higher priority than unary negation, so is read as . To get , write explicitly.
Why do different calculators give different answers? Calculators implement PEMDAS strictly left to right and do not give implied multiplication any special priority. In expressions like , most modern calculators compute , while older models or some scientific calculators compute . This is a calculator design choice, not a mathematical rule, which is why such notation should be avoided.