About the Order of Operations Calculator
This order of operations calculator evaluates an arithmetic expression the way a math teacher expects — parentheses first, then exponents, then multiplication and division from left to right, then addition and subtraction from left to right — and shows the expression after every single operation. Type something like 8 + 2 × (3 + 1)^2 or 48 ÷ 2(9 + 3) and follow the working line by line.
It is for students checking homework, parents helping with PEMDAS or BODMAS worksheets, and anyone settling one of those viral "what is the answer?" puzzles. You can use +, −, ×, ÷ (or * and /), ^ for powers, decimals, negative numbers and round, square or curly brackets. A number written right before a bracket, like 2(3 + 4), is treated as multiplication.
Two conventions matter. Multiplication and division have equal priority and are done left to right, as are addition and subtraction — so 6 ÷ 2 × 3 is 9, not 1. And a leading minus sign applies after the exponent, so −3^2 = −9 while (−3)^2 = 9.
With the default inputs, the result is 38. Change any value above to recalculate instantly.
How to use the order of operations calculator
- 1Type or paste the expression, using × or * for multiply and ÷ or / for divide.
- 2Use ^ for powers, e.g. 2^3 for 2 cubed.
- 3Group with ( ), [ ] or { } exactly as written in your problem.
- 4Read the result, then follow each line of the working to see which rule was applied.
Formula and method
PEMDAS (Parentheses, Exponents, Multiplication/Division, Addition/Subtraction) and BODMAS or BIDMAS (Brackets, Orders/Indices, Division/Multiplication, Addition/Subtraction) describe the same rule. The calculator parses the expression into a tree that encodes these priorities, then repeatedly performs the first operation whose two operands are already plain numbers, rewriting the whole expression after each step.
Operations of equal priority are evaluated left to right (8 − 3 + 2 = 7), except exponents, which stack from the right (2^3^2 = 2^9 = 512). A minus sign in front of a power negates the result of the power, so −3^2 = −9. Implied multiplication such as 2(5) is treated exactly like 2 × 5.
- P / B
- Parentheses / Brackets
- E / O / I
- Exponents / Orders / Indices (powers and roots)
- MD
- Multiplication and division, left to right
- AS
- Addition and subtraction, left to right
Worked examples
Brackets, exponent, then multiply and divide
First the bracket: 3 + 1 = 4. Then the exponent: 4² = 16. Then multiply and divide left to right: 2 × 16 = 32 and 10 ÷ 5 = 2. Finally 8 + 32 − 2 = 38.
The viral 6 ÷ 2(1 + 2)
The bracket gives 3, leaving 6 ÷ 2 × 3. Division and multiplication share a level, so they go left to right: 6 ÷ 2 = 3, then 3 × 3 = 9. (Some older texts give implied multiplication higher priority, which would give 1.)
Negative sign and an exponent
In −3² the exponent is applied first, giving −9, while (−3)² squares the negative number to give 9. Their sum is −9 + 9 = 0.
Nested brackets with decimals
Innermost first: 2 + 0.5 = 2.5, then 2.5 × 3 = 7.5 and 4.5 − 7.5 = −3. Squaring gives 9, and 9 ÷ 2 = 4.5.
Frequently asked questions
What does PEMDAS stand for?+
PEMDAS stands for Parentheses, Exponents, Multiplication and Division, Addition and Subtraction. It is often remembered as "Please Excuse My Dear Aunt Sally". Multiplication and division are one level, as are addition and subtraction.
Is BODMAS the same as PEMDAS?+
Yes. BODMAS (Brackets, Orders, Division/Multiplication, Addition/Subtraction) and BIDMAS (Indices) are the UK and Commonwealth names for the same rules. The order of D and M in the acronym does not matter because they share a level.
Does multiplication come before division?+
No. Multiplication and division have equal priority and are worked left to right. So 12 ÷ 3 × 2 = 4 × 2 = 8. Doing the multiplication first would wrongly give 12 ÷ 6 = 2.
What is the answer to 6 ÷ 2(1 + 2)?+
Using the modern left-to-right convention it is 9: 6 ÷ 2 × 3 = 3 × 3 = 9. The expression is deliberately ambiguous; some people treat 2(1 + 2) as a single unit and get 1. Writing 6 ÷ (2(1 + 2)) or (6 ÷ 2)(1 + 2) removes the doubt.
Why is −3^2 equal to −9?+
The exponent applies only to the 3, and the minus sign is applied afterwards, so −3² = −(3²) = −9. To square negative three you must write (−3)², which equals 9. Most calculators and spreadsheets other than Excel follow this rule.
How are stacked exponents like 2^3^2 evaluated?+
Stacked exponents are evaluated from the top down (right to left): 2^3^2 = 2^(3^2) = 2^9 = 512, not (2^3)^2 = 64. Use brackets if you mean the other order.