Order of Operations Calculator (PEMDAS)

Solve any expression in the correct order — PEMDAS / BODMAS — one step at a time. Supports exponents, roots, and three kinds of brackets.

Loading calculator…

What is the order of operations?

When an expression mixes operations, the order of operations tells you which to do first so everyone gets the same answer. The rule is PEMDAS (or BODMAS): Parentheses, Exponents, Multiplication and Division, Addition and Subtraction.

The order

  1. Parentheses (and other brackets) first, innermost first.
  2. Exponents and roots next, right to left.
  3. Multiplication and Division together, left to right.
  4. Addition and Subtraction together, left to right.
Tip: Multiply-and-divide is one shared level, and add-and-subtract is another. Neither multiplication nor addition automatically comes first — you go left to right within each level.

Two classic traps

  • 4 ÷ 2 × 2 = 4, not 1. Division and multiplication share a level, so you go left to right.
  • 5 − 3 + 2 = 4, not 0. Subtraction and addition share a level, so again left to right.

Exponents go right to left

Stacked exponents evaluate from the top down: 2^3^2 = 512, because it means 2 raised to (3 squared) = 2 to the 9th.

Brackets change everything

  • 4 ÷ (1/2) = 8 — the bracket is computed first, and dividing by one-half doubles.
  • 4 / 1 / 2 = 2 — without a bracket it is just left to right.

Roots

Write k r x for the kth root of x. So 3r8 is the cube root of 8 = 2, and 2r9 is the square root of 9 = 3. A minus sits before a number but not before a bracket — use 0−(3+2), not −(3+2).

Worked example

(10 + 5^2) × ((5 × −2) + 9 − 3^3) ÷ 2 reduces step by step to −490 — parentheses and exponents first, then the outer multiply and divide.

Common mistakes

  • Always multiplying before dividing or adding before subtracting.
  • Reading exponents left to right instead of right to left.
  • Ignoring brackets that regroup a division.

For expressions with only plus and minus signs and negatives, use adding and subtracting integers.

Frequently asked questions

What is PEMDAS?
PEMDAS is the order of operations — Parentheses, Exponents, Multiplication and Division, Addition and Subtraction. BODMAS is the same idea with Brackets and Orders. Multiplication and division share one level, and addition and subtraction share another.
Do you multiply before dividing?
No. Multiplication and division are the same level and are done left to right. So 4 ÷ 2 × 2 equals 4, not 1 — you divide first only because it comes first from the left.
Do you add before subtracting?
No. Addition and subtraction are the same level, done left to right. So 5 − 3 + 2 equals 4, not 0 — the subtraction happens first only because it is further left.
How are stacked exponents evaluated?
Exponents are evaluated right to left, so 2^3^2 means 2 to the power of 3-squared, which is 2 to the 9th, equal to 512 — not 8 squared.
Why is 4 divided by 1/2 equal to 8?
Parentheses come first. 4 divided by the quantity 1/2 is 4 divided by 0.5, which is 8. Without brackets, 4/1/2 goes left to right as 4 divided by 1 divided by 2, equal to 2.
Can this calculator do roots?
Yes. Write k r x for the kth root of x — so 3r8 is the cube root of 8, equal to 2, and 2r9 is the square root of 9, equal to 3. Roots share the exponent level and go right to left.
How do I use a minus sign with a bracket?
A minus may sit before a number, like 5 × −2, but not directly before a bracket. Write a leading zero instead — use 0−(3+2) rather than −(3+2).

Related calculators