Order of Operations Calculator (PEMDAS / BODMAS)
Type any expression and see exactly which operation happens first, next and last, with every step shown and the answer checked. You can also compare your own answer against the classic mistakes, find where brackets turn an expression into a target number, or fill in the missing operators to hit a target. Works with PEMDAS or BODMAS naming.
Background
The order of operations is the agreement that makes every expression mean one thing. Work inside brackets first, then exponents (powers), then multiplication and division from left to right, then addition and subtraction from left to right. PEMDAS (Parentheses, Exponents, Multiplication/Division, Addition/Subtraction) is the US name; BODMAS (Brackets, Orders, Division/Multiplication, Addition/Subtraction) is used in the UK and India. They describe the same rules: 2 + 3 × 4 = 14, not 20, because × outranks +.
How to use this calculator
- Choose Evaluate to solve an expression. You get the value, a tree showing the order each operation happens in, and every step with the working operation highlighted.
- Choose Check My Answer to type an expression and your own result. The calculator tells you if you are right and, if not, which classic mistake produces your number. Use Give me a practice problem to get a fresh expression to try.
- Choose Add Brackets to type numbers and operators in a fixed order plus a target. It tries every way of placing brackets and shows which ones hit the target.
- Choose Fill the Operators to type a list of numbers and a target. It tries every combination of operators between them, using the normal order of operations, and shows the ones that work.
- Pick PEMDAS or BODMAS naming, then click Calculate to see the result, a callout explaining what it means, a diagram and every step. Inputs accept *, x or × for multiplication, / or ÷ for division, and ^, ** or ² for powers.
How the order of operations works
The rules exist so that everyone reads an expression the same way. Without them, 2 + 3 × 4 could mean 14 or 20.
Brackets first. Anything inside brackets is finished completely before it is used. With nested brackets, start with the innermost pair.
Exponents next. Powers outrank everything below them, and they group from the right: 2^3^2 means 2^(3^2) = 512, not (2^3)^2 = 64.
Multiplication and division share one level. Neither outranks the other. Work through them from left to right, so 8 ÷ 2 × 4 is (8 ÷ 2) × 4 = 16, not 8 ÷ 8 = 1.
Addition and subtraction share the last level. Again, left to right: 10 − 3 + 2 is (10 − 3) + 2 = 9, not 10 − 5 = 5.
A minus sign in front of a power is applied after the power: −3² = −(3²) = −9. To square the negative number itself, write (−3)² = 9.
The acronyms are memory aids, not strict ranks. The M and D in PEMDAS (or the D and M in BODMAS) are one level, as are A and S. That is the most common source of mistakes.
Brackets are the only way to override the ranking. Moving them changes which operation happens last, and that is why the same numbers and operators can produce many different results.
Rules & Formulas Used
Priority order: ( ) first > ^ > × and ÷ (left to right) > + and − (left to right)
Next operation: innermost bracket → highest rank present → leftmost operation of that rank
Exponents group right: a^b^c = a^(b^c)
Negative sign and powers: −a^b = −(a^b), (−a)^b uses the brackets
Subtraction and division as addition: a − b = a + (−b), a ÷ b = a × (1/b)
Ways to bracket n numbers: Catalan number C(n−1) = (2k)! / (k! (k+1)!) with k = n − 1 operators: 1, 2, 5, 14, 42, 132, 429
Operator combinations: m^(n−1) for m operators allowed and n numbers
Fraction display: non-whole results are matched to the simplest fraction (continued fractions)
Example Problems & Step-by-Step Solutions
Example 1 — Multiplication before addition
Evaluate 2 + 3 × 4.
Step: × outranks +, so do 3 × 4 = 12 first. Then 2 + 12.
Result: 14. Working left to right would wrongly give (2 + 3) × 4 = 20.
Example 2 — Brackets change the order
Evaluate (2 + 3) × 4.
Step: Brackets first: 2 + 3 = 5. Then 5 × 4.
Result: 20. The same numbers and operators as Example 1, a different answer.
Example 3 — Left to right at one level
Evaluate 8 ÷ 2(2 + 2), treating 2(…) as ordinary multiplication.
Step: Brackets: 2 + 2 = 4, giving 8 ÷ 2 × 4. ÷ and × share a level, so go left to right: 8 ÷ 2 = 4, then 4 × 4.
Result: 16. If you instead bind 2(…) tighter you would get 8 ÷ 8 = 1, which is why the notation is ambiguous.
Example 4 — The negative sign and a power
Evaluate −3² + (−3)².
Step: −3² = −(3²) = −9. (−3)² = 9. Then −9 + 9.
Result: 0.
Example 5 — Every rank in one expression
Evaluate 100 − 4 × (3 + 2)² ÷ 5 + 6.
Step: Brackets: 3 + 2 = 5. Exponent: 5² = 25. Then × and ÷ left to right: 4 × 25 = 100, 100 ÷ 5 = 20. Then + and − left to right: 100 − 20 = 80, 80 + 6.
Result: 86.
Example 6 — Tracing a wrong answer
A student says 10 − 3 + 2 = 5.
Step: They added 3 + 2 = 5 before subtracting, as if A came before S. Correct: 10 − 3 = 7, then 7 + 2.
Result: the right answer is 9; the slip is "added before subtracting".
Example 7 — Placing brackets to hit a target
Where can brackets go in 2 × 3 + 4 × 5 to make 50?
Step: With no brackets: 6 + 20 = 26. The bracketing (2 × 3 + 4) × 5 does 6 + 4 = 10 first, then 10 × 5.
Result: 50. The five possible bracketings give 26, 46, 50 and 70.
Example 8 — Filling in operators
Use + − × ÷ between four 4s (no brackets) to make 17.
Step: Try 4 × 4 + 4 ÷ 4. The × and ÷ go first: 16 and 1. Then 16 + 1.
Result: 17. There are 4³ = 64 lines to check; the calculator tests them all.
Frequently Asked Questions
Are PEMDAS and BODMAS the same?
Yes. Only the names differ: Parentheses = Brackets and Exponents = Orders. Both rank multiplication and division together, and addition and subtraction together.
Does multiplication always come before division?
No. They share a level and are done left to right. 8 ÷ 2 × 4 = 16, while doing the multiplication first would wrongly give 1. The same holds for addition and subtraction.
Why is −3² equal to −9?
The power is applied to 3 first and the minus sign is applied afterwards. Write (−3)² when you want the negative number squared, which gives 9.
Why do some calculators disagree on 8 ÷ 2(2 + 2)?
Writing 2(…) without a sign is ambiguous. This calculator treats it as normal multiplication, giving 16. Some devices bind it tighter and give 1. Writing the × and brackets explicitly removes the doubt.
How are stacked exponents handled?
From the right, so 2^3^2 = 2^(3^2) = 512. Many students expect 64, which comes from grouping from the left.
What does left to right mean exactly?
Among operations at the same level, the one written furthest left is done first. In 12 ÷ 3 × 2 the division comes first, so the answer is 8.
Why do brackets change the answer so much?
They are the only way to override the ranking. Moving them changes which operation is done last, so the same numbers and operators can give many results, as the Add Brackets mode shows.
What happens with division by zero?
Dividing by zero is undefined, so the calculator stops and says where it happens. The same applies to 0 raised to a negative power.
Why can the operator puzzle have no answer?
Without brackets the ranking fixes the order of work, which limits the values you can make. Some targets only work when brackets are allowed, and the calculator tells you when one such bracketing exists.
Can I practise with it?
Yes. In Check My Answer, choose a level and click the practice button. You get an expression where working left to right would give the wrong answer. Solve it on paper, type your answer and see whether you fell into the trap.
Does it handle percentages, roots or variables?
Not directly. Write 50% as 0.5, and a square root as a power of 1/2, like 9^(1/2) = 3. Variables are not supported: substitute a number first, then evaluate.
How accurate are the results?
Values are carried at full precision and shown to the number of decimals you pick, so redoing a step by hand with rounded numbers can differ in the last digit.