Order of Operations Calculator
This order of operations calculator simplifies an expression one step at a time: brackets first, then exponents, then multiplication and division, then addition and subtraction. 18 ÷ 6 + 4(5 − 2) gives 15, and the table shows each step with the rule that was used.
How it is calculated
The order of operations is: 1. brackets (innermost first), 2. exponents, 3. multiplication and division from left to right, 4. addition and subtraction from left to right. The textbook OpenStax Prealgebra explains why the rule is needed: without it 4 + 3 · 7 could mean 49 or 25. With the agreed order, multiplication comes first, so 4 + 21 = 25. The memory aid PEMDAS (“Please Excuse My Dear Aunt Sally”) stands for parentheses, exponents, multiplication and division, addition and subtraction.
Order of operations examples
| Expression | Result |
|---|---|
| 4 + 3 · 7 | 25 |
| (4 + 3) · 7 | 49 |
| 12 − 5 · 2 | 2 |
| 18 ÷ 9 · 2 | 4 |
| 18 · 9 ÷ 2 | 81 |
| 18 ÷ 6 + 4(5 − 2) | 15 |
| 30 ÷ 5 + 10(3 − 2) | 16 |
| 5 + 2³ + 3[6 − 3(4 − 2)] | 13 |
| 2³ + 3⁴ ÷ 3 − 5² | 10 |
| 9 + 5³ − [4(9 + 3)] | 86 |
A worked example: 18 ÷ 6 + 4(5 − 2). The bracket comes first, 5 − 2 = 3. Then multiplication and division from left to right: 18 ÷ 6 = 3, then 4 · 3 = 12. Finally the addition: 3 + 12 = 15.
Left to right for operations of equal rank
Multiplication and division have the same priority, and so do addition and subtraction. They are not done in a fixed order (“multiply before divide”), but in the order they appear from left to right. That is why 18 ÷ 9 · 2 = 2 · 2 = 4 and not 18 ÷ 18 = 1. With nested brackets, the innermost one is simplified first: in 5 + 2³ + 3[6 − 3(4 − 2)] the round bracket gives 2, the square bracket becomes 6 − 6 = 0, and the result is 5 + 8 + 0 = 13.
- The calculator works with exact fractions: 7 ÷ 2 is shown as 3.5, 1 ÷ 3 as 1/3 with a decimal approximation.
- A minus sign in front of a power comes after the power: −3² = −(3²) = −9, while (−3)² = 9 (OpenStax Prealgebra, Example 10.13). The calculator shows the brackets it adds. A tower of powers such as 2^3^2 is rejected because the textbook does not settle it – please add brackets.
- Exponents must be whole numbers; roots are not part of this tool.
To add or simplify fractions on their own, use the fraction calculator; large powers and their rules are covered by the exponent calculator.
Frequently asked questions
What is the correct order of operations?
Brackets first (innermost first), then exponents, then multiplication and division from left to right, then addition and subtraction from left to right.
Does multiplication always come before division?
No. Multiplication and division have equal priority and are done from left to right: 18 ÷ 9 · 2 = 4, and 18 · 9 ÷ 2 = 81.
What does PEMDAS stand for?
Parentheses, Exponents, Multiplication and Division, Addition and Subtraction – remembered as “Please Excuse My Dear Aunt Sally”. M and D (like A and S) belong together.
How do I enter 4(5 − 2)?
Exactly like that: a number directly in front of a bracket means multiplication. The calculator writes it as 4 · (5 − 2) and works out the bracket first.
What is −3²?
−9. Only the 3 is squared, then the sign is applied: −3² = −(3²). OpenStax Prealgebra shows this in Example 10.13 (−3⁴ = −81, but (−3)⁴ = 81). For (−3)² = 9 type the brackets.
Sources and legal basis
- OpenStax Prealgebra 2e, 2.1 Use the Language of Algebra – Order of Operations: 1. parentheses and other grouping symbols (innermost first), 2. exponents, 3. multiplication and division left to right, 4. addition and subtraction left to right; Examples 2.8–2.12 (4 + 3·7 = 25, 18 ÷ 6 + 4(5 − 2) = 15, 5 + 2³ + 3[6 − 3(4 − 2)] = 13) (read 10.10.2026)
- OpenStax Prealgebra 2e, 10.2 Use Multiplication Properties of Exponents – Example 10.13: (−3)⁴ = 81, −3⁴ = −(3·3·3·3) = −81 (“we raise only the 3 to the 4th power and then find the opposite”) (read 10.10.2026)
- OpenStax Prealgebra 2e, 10.4 Divide Monomials – Zero Exponent: “If a is a non-zero number, then a⁰ = 1” (read 10.10.2026)
As of: · Editorial policy
Related tools
- Fraction CalculatorFraction calculator with steps: add, subtract, multiply and divide fractions and mixed numbers or type a whole expression. Simplify, compare, convert to %.
- Exponent calculator with stepsCalculate powers, nth roots and logarithms with any base – step-by-step, with negative and fractional exponents, ln, log and scientific notation.
- Scientific CalculatorFree online scientific calculator: sin, cos, tan in degrees or radians, log, ln, roots, powers, factorial and nCr – with step-by-step working and history.
- Online CalculatorCalculator online, free and instant: type or tap and see the answer as you go – order of operations, brackets, percent, square root, steps and a history list.
- Expand Polynomial CalculatorExpand polynomial calculator: multiply out brackets and powers, spot the special product formulas and see every step, also with several variables.
- Long division calculatorLong division and long multiplication step by step: quotient, remainder and check, optionally with decimal places – for practising and checking homework.
- Interactive Periodic Table of the ElementsPeriodic table with all 118 elements: atomic mass, electron configuration, melting and boiling point. Search, temperature slider, colour modes, print to PDF.
- SGPA calculator (grades and credits)SGPA calculator for Indian universities: enter each course with its grade and credits to get your semester grade point average by the UGC formula, step by step.
- Latent Heat CalculatorLatent heat calculator: Q = m·L for melting, freezing, boiling and condensing, with table values for 16 substances and the full heating curve of water.