Order of Operations Calculator (BODMAS & PEMDAS)
BODMAS/PEMDAS one step at a time, in exact fractions, with every rule named.
Answer
This is the last answer worked out. Fix the expression above to update it.
Step by step
BODMAS: Brackets, Orders (powers and roots) and “of”, Division and Multiplication (left to right), Addition and Subtraction (left to right). PEMDAS: Parentheses, Exponents, Multiplication and Division, Addition and Subtraction — the same order.
About the Order of Operations Calculator (BODMAS & PEMDAS)
Type an arithmetic expression — with brackets, powers, roots, fractions, decimals, “of”, × ÷ + and − — and see it worked out one operation at a time, in the order BODMAS and PEMDAS give. Each step marks the part being worked on, shows the calculation and says which rule makes it next: brackets first, then powers and roots, then × and ÷ from left to right, then + and − from left to right.
All the arithmetic is exact: 1/3 stays 1/3 instead of 0.333…, and the answer is given as a fraction, a mixed number and a decimal. Expressions that people read in two ways — the famous 6 ÷ 2(1 + 2), stacked powers such as 2^3^2, “of” after a division, or a typed fraction after ÷ or ^ (8^2/3) — are flagged, with the working for both readings, so you can see exactly where the disagreement comes from.
How to use it
- Type the expression, for example
3 + 4 × 2 ÷ (1 − 5)^2. Use*or × to multiply,/or ÷ to divide,^for powers (or ² and ³), √ for square roots and “of” as in1/2 of 10. The buttons insert the symbols that are hard to type on a phone. - Read the steps: the marked part is worked out next, the green underline shows the result of the previous step, and the line below gives the rule.
- If the expression is ambiguous, a yellow box explains both readings; choose a reading to see its steps.
- Copy the answer or all the steps, or print them.
Examples
3 + 4 × 2 ÷ (1 − 5)^2
7/2 = 3 1/2 = 3.5
Brackets: 1 − 5 = −4. Powers: (−4)^2 = 16. Then left to right: 4 × 2 = 8 and 8 ÷ 16 = 1/2. Last: 3 + 1/2 = 7/2.
6 ÷ 2(1 + 2)
9, or 1 if implied multiplication goes first
Left to right: (6 ÷ 2) × 3 = 9. With 2(1 + 2) taken as one unit: 6 ÷ 6 = 1. Both readings are shown.
1/2 + 3/4 × 2
2
3/4 × 2 = 3/2, then 1/2 + 3/2 = 2.
−3^2
−9
The power comes first: −(3^2). (−3)^2 is 9.
1/2 of 10 + 3
8
“Of” means multiply and comes before the addition: 5 + 3.
Common uses
- Checking order-of-operations homework, step by step.
- Settling an argument about a viral puzzle — and seeing why both sides think they are right.
- Simplifying long expressions with fractions without rounding errors.
- Teaching BODMAS or PEMDAS with worked examples.
The order of operations
- Brackets (Parentheses): work out the inside of brackets first, starting with the innermost.
- Orders (Exponents): powers and roots, such as 2^3 and √16.
- Division and Multiplication: these rank equally, so work from left to right. In BODMAS, “of” (as in ½ of 10) means multiply and is worked out before them.
- Addition and Subtraction: these also rank equally, left to right.
BODMAS (the United Kingdom and other Commonwealth countries), BIDMAS (I for indices), BEDMAS (Canada and New Zealand) and PEMDAS (the United States) are different names for the same order. The order of the letters D and M — or M and D — does not mean division comes before multiplication: they rank equally, and so do A and S.
Left to right
Operations of equal rank are done from left to right: 12 ÷ 3 × 2 = 4 × 2 = 8, not 12 ÷ 6 = 2; and 20 − 5 + 3 = 18, not 12. Powers are the exception: stacked powers are worked from the top down, so 2^3^2 = 2^9 = 512.
Negative numbers and powers
A minus sign in front of a power applies after the power: −3^2 = −(3^2) = −9. To square −3, write (−3)^2 = 9. Spreadsheets are an exception: Microsoft’s operator precedence table lists negation before ^, so in Excel =-3^2 gives 9.
Why some expressions are ambiguous
Written mathematics usually avoids ÷ and long slash fractions, so a few typed expressions have no single agreed reading (Wikipedia: Order of operations):
- Implied multiplication after a division, as in 6 ÷ 2(1 + 2). Taught strictly, × and ÷ go left to right and the answer is 9. Many academic texts and style guides — the Physical Review style guide among them — treat a product written by juxtaposition as one unit, so 1/2n means 1/(2n), and that gives 1. Calculators differ too: a Casio fx-82MS gives 1 and a TI-83 Plus gives 9.
- Stacked powers typed with ^: 2^3^2 is 512 in Google and Wolfram Alpha (top down) but 64 in Excel and MATLAB (left to right).
- A typed fraction after ÷: 6 ÷ 3/4 is (6 ÷ 3) ÷ 4 = 1/2 by the left-to-right rule, but 8 if 3/4 is meant as a fraction.
- A typed fraction after ^: a power applies only to the number right after the ^, so 8^2/3 is 8² ÷ 3 = 64/3; the exponent 2/3 needs brackets, 8^(2/3) = 4.
The cure is the same each time: add brackets or an explicit ×, so that only one reading is possible.
Limitations
- Results are kept exact, so an irrational value such as √2 or 2^(1/2) stops the calculation with an explanation; use the scientific calculator for decimals, or the exponent calculator for powers and roots in simplest radical form.
- Variables (x, y), functions such as sin, percentages and factorials are not supported — this is a tool for arithmetic.
- Expressions can be up to 300 characters long and take up to 150 steps; a step may not produce a number with more than 1,000 digits.
- The tool follows the left-to-right convention for its main answer and shows the other common reading when an expression is ambiguous. It cannot know which one your teacher or textbook intends.
Privacy
Everything happens in your browser. What you enter or open here is not uploaded or stored by MySmartCoPilot.
Frequently asked questions
What is 6 ÷ 2(1 + 2)?
By PEMDAS/BODMAS as usually taught it is 9: brackets give 6 ÷ 2 × 3, and ÷ and × are worked left to right, so 3 × 3 = 9. If implied multiplication is taken to bind more tightly — a common convention in algebra — it is 6 ÷ 6 = 1. The expression is ambiguous; write (6 ÷ 2)(1 + 2) or 6 ÷ (2(1 + 2)) to make it clear.
Does multiplication come before division?
No. Multiplication and division rank equally and are worked from left to right, whichever comes first. The same goes for addition and subtraction. So 8 ÷ 2 × 4 = 16 and 10 − 3 + 2 = 9.
What does the O in BODMAS stand for?
“Of”, as in ½ of 10, meaning multiply — and sometimes Order, meaning powers and roots (Wikipedia: Order of operations). The calculator does both: powers and roots first, then “of”, before ÷ and ×. So 12 ÷ 3 of 2 = 12 ÷ 6 = 2. If “of” is treated as an ordinary ×, left to right gives 8, so the tool flags that case.
Is BODMAS the same as PEMDAS?
Yes. Brackets = Parentheses and Orders = Exponents; both then do division and multiplication together, left to right, and finally addition and subtraction together, left to right. BIDMAS and BEDMAS are the same order with other names.
Why is −3² equal to −9?
Because the power is worked out before the minus sign is applied: −3² means −(3²). To square negative three, write (−3)². Excel is a well-known exception and gives 9 for =-3^2.
Can I use decimals and fractions together?
Yes. 0.5 is kept as exactly 1/2 and 0.1 as 1/10, so 0.1 + 0.2 = 0.3 exactly. Choose how numbers appear in the working with Numbers in the working: as typed, as fractions or as decimals (a decimal that never ends is still shown as a fraction).