Skip to content

The rule behind every arithmetic step

Order of Operations

The order of operations is the agreed-upon sequence for evaluating a math expression that mixes several operations, so that everyone gets the same answer from the same expression. It is the rule behind every arithmetic step the math solver on the homepage shows: parentheses first, then exponents, then multiplication and division, then addition and subtraction.

The rule, in order

Most English-speaking countries teach this as PEMDAS (Parentheses, Exponents, Multiplication and Division, Addition and Subtraction); many other countries teach the identical rule as BODMAS or BIDMAS (Brackets, Orders, Division and Multiplication, Addition and Subtraction). Both acronyms describe exactly the same four-level priority order, just with different local names for the same categories.

  1. Parentheses / Brackets: evaluate anything inside ( ) first, working from the innermost pair outward if they are nested.
  2. Exponents / Orders: evaluate powers and roots next, such as squaring a number or taking a square root.
  3. Multiplication and Division: evaluate these together, working strictly left to right (multiplication is not always done before division; whichever comes first, left to right, goes first).
  4. Addition and Subtraction: evaluate these last, also together and left to right (addition is not always done before subtraction).

A common misconception

The acronym PEMDAS makes it look like multiplication always happens before division, and addition always happens before subtraction, because that is the order the letters are written in. That is not quite right. Multiplication and division are actually the same priority level and are evaluated left to right in whichever order they appear; the same is true for addition and subtraction. For example, in 20 / 4 * 2, division is written first, so it happens first: 20 / 4 = 5, then 5 * 2 = 10. Evaluating the multiplication first instead would give the wrong answer, 20 / (4 * 2) = 2.5, which is not what the expression, as written without parentheses, actually means.

Worked example: mixing all four levels

Take 2 + 3 * (4 - 1)^2, the same example used on the examples page. Working through the four levels in order: the parentheses resolve first (4 - 1 = 3), then the exponent (3^2 = 9), then the multiplication (3 * 9 = 27), and finally the addition (2 + 27 = 29). Each level is fully resolved before moving to the next; you never jump ahead to addition while an exponent is still unresolved elsewhere in the expression.

Why the rule exists at all

Without an agreed order, an expression like 2 + 3 * 4 would be ambiguous: read left to right with no priority rules it could mean (2 + 3) * 4 = 20, or it could mean 2 + (3 * 4) = 14, and there would be no way to tell which was intended just by looking at it. The order of operations exists specifically to remove that ambiguity, so that any two people (or a person and a calculator, or two different calculators) reading the same expression always get the same answer. It is a notational convention, agreed on for consistency, not a mathematical law that could be 'discovered' to be different.

Nested parentheses

When parentheses are nested inside other parentheses, work from the innermost pair outward. For 2 * (1 + (3 * 4)), the innermost operation is 3 * 4 = 12, which turns the expression into 2 * (1 + 12), and then 1 + 12 = 13, giving 2 * 13 = 26. The math solver handles nested parentheses of any depth the same way, always resolving the deepest available parentheses first, which is exactly this left-to-right, innermost-first process, just automated.

How this connects to solving equations

Order of operations is not just for plain arithmetic, it is also what makes expanding and simplifying the left and right sides of an equation well-defined before you start moving terms around. When the solver expands something like 3*(x + 2) - 2*x as part of solving a linear equation (see the worked examples with distributed terms), it is relying on the same underlying rule: the multiplication distributes across the parentheses before the subtraction of the 2*x term is applied. Getting that order right is what separates a correct simplification from a common hand-solving mistake.

Negative numbers and order of operations

Negative signs add a wrinkle worth calling out on their own. In -3^2, the exponent applies to the 3 alone, not to the negative sign, so the result is -9, not 9 (that convention treats the leading minus as a separate subtraction/negation applied after the exponent). To square a negative three and get a positive result, the negative sign needs its own parentheses: (-3)^2 = 9. This single-character difference between -3^2 and (-3)^2 is one of the most common sources of a wrong sign in an otherwise correct calculation, and it is exactly the kind of subtlety that a step-by-step breakdown makes visible instead of hiding inside a single jumped-to answer.

Common order-of-operations mistakes

A short list of the mistakes that come up most often, worth checking against whenever an answer looks surprising:

Quick reference table

PriorityOperationExample
1 (highest)Parentheses / Brackets(2 + 3) evaluated before anything outside it
2Exponents / Roots2^3 evaluated before addition or multiplication around it
3Multiplication and DivisionLeft to right: 20 / 4 * 2 = 10, not 2.5
4 (lowest)Addition and SubtractionLeft to right: 10 - 4 + 2 = 8, not 4

Frequently asked questions

Can I practice this rule with my own numbers?
Yes. Type any expression into the math solver on the homepage and it narrates each step in this same order, or see the worked examples page for several complete walkthroughs. Nothing you type is sent anywhere; see the privacy policy for the detail.
Is PEMDAS the same as BODMAS?
Yes. They describe the identical priority order (grouping symbols, then powers/roots, then multiplication/division together, then addition/subtraction together); they are just the common acronyms used in different countries for the same rule.
Does multiplication always come before division?
No. Multiplication and division share the same priority level and are evaluated left to right in whichever order they appear in the expression, not always multiplication first.
What about addition and subtraction?
The same rule applies: they share a priority level and are evaluated left to right, not always addition first.
How does the math solver apply this rule?
It repeatedly finds the deepest fully-resolved operation in the expression (which, because of how parentheses and exponents are structured, always corresponds to the next step the order of operations would require) and reduces it, one step at a time, until a single number remains. See the homepage for a full worked example.

Practice with the solver

Type any expression and watch it apply this exact order.

Open the math solver

Kostenlos. Keine Anmeldung.