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.

Source: 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). Updated: .

Use + − × ÷ (or * /), ^ or ² ³ for powers, and ( ) [ ] { }. A number directly before a bracket means multiply: 4(5 − 2). Decimals with a point.
My ToolboxYour inputs are saved in this browser only.

Result

Result
18 ÷ 6 + 4 · (5 − 2) = 15
Steps
StepRuleCalculationExpression after the step
1Inside brackets: add/subtract, left to right5 − 2 = 318 ÷ 6 + 4 · 3
2multiply/divide, left to right18 ÷ 6 = 33 + 4 · 3
3multiply/divide, left to right4 · 3 = 123 + 12
4add/subtract, left to right3 + 12 = 1515
Calculated exactly with fractions in the order brackets → exponents → multiplication and division → addition and subtraction; operations of equal rank go from left to right.

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

ExpressionResult
4 + 3 · 725
(4 + 3) · 749
12 − 5 · 22
18 ÷ 9 · 24
18 · 9 ÷ 281
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.

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

As of: · Editorial policy

Related tools