Order of Operations Calculator
This order of operations calculator takes a whole expression — brackets, exponents, multiplication, division, addition, subtraction, modulo and absolute value bars — and solves it one operation at a time, naming each step. Where a left-to-right reading would give something different, it shows you that answer too.
^ for powers, ( ) for brackets, % for modulo. *, x and × all mean multiply.How to use the order of operations calculator
- Type the expression into the box exactly as it is written. Use
^for powers,( ),[ ]or{ }for brackets,%for modulo and| |for absolute value. *,xand×all mean multiply;/and÷both mean divide.- Read the answer at the top. It recalculates on every keystroke, so a half-typed expression will simply say what is missing.
- Work down the step list underneath. Each line shows one operation and names it, in the order the rules require.
If the expression contains no brackets and reading it straight through would have produced a different number, that wrong answer is shown as well, so you can see exactly what the rules saved you from.
The order of operations in full
That shared-rank point is the part that goes wrong most often. Multiplication does not outrank division, and addition does not outrank subtraction. Within a rank you work strictly left to right, in reading order.
Do all the multiplying before all the dividing in the first line and you get 1 instead of 9. The rule is not “multiply, then divide”; it is “multiply and divide as you meet them”.
Modulo sits in the same rank as multiplication and division, so 17 % 5 × 2 is 2 × 2 = 4. Absolute value bars behave like brackets: whatever is inside them is finished first, then the sign is dropped.
The rule has several names. PEMDAS, BODMAS, BIDMAS and BEDMAS are all the same order under different initials; the PEMDAS calculator covers the mnemonics and the arguments that surround them.
Worked examples
Example: 6 + 4 × (12 − 8) ÷ 2
Brackets first, then the multiply and divide pair left to right, then the addition.
The answer is 14. Straight left to right it would have been 6 + 4 = 10, × 4 = 40, ÷ 2 = 20.
Example: 48 ÷ 2^3 + 5 × 3
The exponent is resolved before anything touches it.
The answer is 21. Note that the division and the multiplication are independent here, so their order between themselves changes nothing.
Example: 3 + 2 × 4^2 − 10 ÷ 5
The answer is 33. Reading straight through would have given 78.
Nested brackets, from the inside out
When brackets sit inside brackets, always start with the innermost pair and work outward. Each pair is a self-contained problem that follows the same four ranks internally.
Example: 2 × (3 + (4 − 1) × 2)
Square brackets and braces are just brackets with a different shape, used to keep long expressions readable. 40 ÷ [2 + (3 × 6)] is 40 ÷ 20 = 2. There is no rule that gives square brackets priority over round ones; only nesting depth matters.
A fraction bar acts as a pair of invisible brackets. Everything above the line is finished, everything below the line is finished, and only then do you divide. Typed on one line that has to become explicit, so a fraction with 3 + 5 on top and 2 × 2 underneath is (3 + 5) ÷ (2 × 2) = 2. The same goes for absolute value bars, which the absolute value calculator handles on their own: |3 − 11| resolves the subtraction to −8, then drops the sign to give 8.
Writing 2(3 + 4) with no operator means multiply, and this calculator reads it that way: brackets first, giving 7, then 2 × 7 = 14.
Exponents: minus signs and stacked powers
Two exponent rules cause more trouble than everything else combined.
A minus sign in front of a power is not part of the base. In standard notation −3² means −(3²), so you square 3 to get 9 and then negate it: −9. Only brackets attach the sign to the base, and (−3)² = 9. The exponent binds tighter than the negation.
Stacked exponents work right to left. Every other operator in the list associates left to right, but a tower of powers is evaluated from the top down.
512 and 64 are both defensible-looking answers, and only the right-to-left convention is correct. The reason is that left-to-right stacking would be pointless: (2^3)^2 is already just 2^6, so it needs no special notation. Right-to-left grouping is the only reading that gives towers their own meaning.
Where reading left to right goes wrong
The order of operations exists because an expression is a single object, not a sequence of instructions. Below are expressions with no brackets at all, and the answer you would get by simply working from the left.
| Expression | Left to right | Correct | What the rule changes |
|---|---|---|---|
| 2 + 3 × 4 | 20 | 14 | The multiplication happens first |
| 8 − 6 ÷ 2 | 1 | 5 | Divide before you subtract |
| 20 − 4 × 3 + 6 | 54 | 14 | 4 × 3 is one term, taken out in one piece |
| 5 + 2^3 | 343 | 13 | The exponent applies to 2 alone, not to 5 + 2 |
| 1 + 2 × 3^2 | 81 | 19 | Exponent, then multiply, then add |
| 6 ÷ 2 + 4 × 5 | 35 | 23 | Two separate products, added at the end |
| 10 − 2 × 3 + 4 | 28 | 8 | Only the 2 × 3 is grouped |
The pattern behind every row is the same: multiplication and division bind their two neighbors into a single term, and addition and subtraction only join finished terms together. In 20 − 4 × 3 + 6 the terms are 20, 4 × 3 and 6, so the sum is 20 − 12 + 6 = 14. Read the expression as terms first and the answer falls out with much less counting.
Common mistakes
- Doing all the multiplication before any division. They share a rank. 12 ÷ 4 × 3 is 9, not 1.
- Doing all the addition before any subtraction. Same rank again. 10 − 3 + 2 is 9, not 5.
- Working outward-in through nested brackets. The innermost pair is always resolved first.
- Attaching a minus sign to a base. −3² is −9. Only (−3)² is 9.
- Stacking exponents left to right. 2^3^2 is 512, not 64.
- Dropping an implied multiplication. 2(3 + 4) means 2 × 7 = 14, not 234 or 2 + 7.
- Forgetting that a fraction bar groups. Rewritten on one line, both the numerator and the denominator need brackets around them.
- Assuming a subtraction can be reordered. Terms carry their signs, so 20 − 12 + 6 is not the same as 20 − (12 + 6).
When a single multiplication inside an expression is the part you are unsure of, the multiplication calculator will show that step’s working in full.
Frequently asked questions
What is 6 + 4 × (12 − 8) ÷ 2?
The answer is 14. Brackets first: 12 − 8 = 4. Then the multiplication and division in reading order: 4 × 4 = 16, then 16 ÷ 2 = 8. Finally the addition: 6 + 8 = 14. Working straight from the left would have given 20.
What is 2 + 3 × 4?
It is 14, not 20. Multiplication outranks addition, so 3 × 4 = 12 is worked out first and then 2 is added. Read it as terms: the expression is 2 plus one term of 3 × 4. To make 20 you would need brackets: (2 + 3) × 4.
Do multiplication and division really have equal priority?
Yes. They are one rank, worked left to right as you meet them. 12 ÷ 4 × 3 = 9, because 12 ÷ 4 = 3 comes first and then 3 × 3 = 9. Treating multiplication as senior gives 12 ÷ 12 = 1, which is wrong. Addition and subtraction pair up the same way.
Is −3² equal to −9 or 9?
Written in standard notation, −3² is −9, because the exponent applies to the 3 and the minus sign is applied afterwards. (−3)² is 9, because the brackets make −3 the base. The calculator above follows the standard convention, so typing -3^2 returns −9 and (-3)^2 returns 9.
What is 2^3^2?
It is 512. Stacked exponents are evaluated from the right, so 3^2 = 9 is resolved first and then 2^9 = 512. Going left to right would give (2^3)^2 = 64, which is wrong. If you want that value, write the brackets in.
Do brackets always come first?
Yes, and innermost first when they are nested. Inside a pair of brackets the same four ranks apply, so a bracket is a smaller version of the whole problem. Square brackets and braces carry no extra priority; they are used only to make deep nesting easier to read.
How do you handle a fraction written on one line?
A fraction bar groups everything above it and everything below it, so put brackets around both when you flatten it. A fraction with 3 + 5 on top and 2 × 2 underneath becomes (3 + 5) ÷ (2 × 2) = 2. Typing 3 + 5 ÷ 2 × 2 instead gives 8, a completely different expression.
What if an expression has no brackets at all?
Then the ranks alone decide. Do the exponents, then the multiplications, divisions and modulos left to right, then the additions and subtractions left to right. In 3 + 2 × 4² − 10 ÷ 5 that gives 16, then 32 and 2, then 3 + 32 − 2 = 33.
Related calculators
Put this calculator on your own site (free)
Copy this into any page. The calculator stays up to date on its own, works on mobile, and carries a small credit link back here.
https://fourfunctioncalculator.com/order-of-operations-calculator/