When an expression mixes several operations, everyone has to agree on which one to do first — otherwise 3 + 6 × 2 could be 18 or 15. The convention taught in US schools is PEMDAS. This calculator applies it one step at a time, names the rule used at each step and highlights the part of the expression being simplified, so you can follow along or check homework.
How to use the order of operations calculator
- Type the expression. You can use + − × ÷ or * and /, ^ for exponents, and parentheses ( ), brackets [ ] or braces { } for grouping.
- A number written right next to parentheses multiplies, so 2(3 + 4) means 2 × (3 + 4).
- The answer appears on the tape, and Step by step lists every operation in the order it is performed, with the expression rewritten after each step.
- Fractions stay exact: 1 ÷ 3 is carried as 1/3, so 1 ÷ 3 × 3 returns exactly 1.
The PEMDAS rules
Parentheses first
Work inside grouping symbols before anything else, starting with the innermost pair. Inside the parentheses the same order applies.
Exponents next
Powers and roots come before multiplication. Stacked exponents are evaluated from the top down: 2^3^2 = 2^9 = 512.
Multiplication and division together
These have the same rank. Do whichever comes first as you read from left to right. The memory aid “PEMDAS” makes it look as if M beats D, but it does not.
Addition and subtraction together
Again, equal rank, left to right. 10 − 4 + 3 is (10 − 4) + 3 = 9, not 10 − 7 = 3.
Worked example
Simplify 3 + 6 × (5 + 4) ÷ 3 − 7:
- Parentheses: 5 + 4 = 9, giving 3 + 6 × 9 ÷ 3 − 7.
- Multiplication (it comes first from the left): 6 × 9 = 54, giving 3 + 54 ÷ 3 − 7.
- Division: 54 ÷ 3 = 18, giving 3 + 18 − 7.
- Addition (leftmost): 3 + 18 = 21, giving 21 − 7.
- Subtraction: 21 − 7 = 14.
Common mistakes
| Expression | Wrong | Right | Why |
|---|---|---|---|
| 3 + 6 × 2 | 18 | 15 | Multiply before adding |
| 8 ÷ 2 × 4 | 1 | 16 | Divide and multiply left to right |
| 10 − 4 + 3 | 3 | 9 | Subtract and add left to right |
| −3^2 | 9 | −9 | The exponent applies before the minus |
| 2 × 3^2 | 36 | 18 | Square first: 2 × 9 |
Tips
- When in doubt, add parentheses. They never hurt and they make your intent clear to readers and to calculators.
- Treat a fraction bar as a grouping symbol: in (4 + 8) ÷ (2 + 1), both the top and the bottom are worked out before dividing.
- Negative numbers after an operator are wrapped in parentheses in the steps, such as 5 − (−3), to keep the signs readable. For more practice with signs, see the adding and subtracting integers calculator.
- For quick everyday arithmetic, the basic calculator follows the same rules; for functions like sin and log, use the scientific calculator.
Frequently asked questions
What does PEMDAS stand for?
Parentheses, Exponents, Multiplication and Division, Addition and Subtraction. Multiplication and division share one level and are done left to right; addition and subtraction share the next level and are also done left to right.
Is multiplication always done before division?
No. They have equal priority, so you work from left to right. In 8 ÷ 2 × 4 you divide first (8 ÷ 2 = 4) and then multiply (4 × 4 = 16). The same rule applies to addition and subtraction.
What is the answer to 8 ÷ 2(2 + 2)?
Using the standard rules, the parentheses give 4, leaving 8 ÷ 2 × 4. Working left to right gives 4 × 4 = 16. Some textbooks treat implied multiplication as binding tighter, which gives 1, so mathematicians avoid writing expressions this way.
Why is −3² equal to −9?
The exponent is applied before the negative sign, so −3² means −(3²) = −9. To square negative three, write (−3)², which is 9.
Are BODMAS and BEDMAS different from PEMDAS?
No. BODMAS (Brackets, Orders, Division/Multiplication, Addition/Subtraction) and BEDMAS are the British and Canadian names for the same rules. Only the words differ.