Order of Operations Calculator
Type an expression and watch it reduced one operation at a time in the correct order: brackets, exponents, multiplication and division, then addition and subtraction. Every intermediate value is an exact fraction, and the cases where textbooks and calculators disagree — −2², 2^3^2 and 8 ÷ 2(2 + 2) — are flagged and explained. Free, no sign-up.
Use + − × ÷ ^ and brackets ( ) [ ] { }. Write × as * and ÷ as / if you like; use a decimal point, not a comma.
Try an example
Results
4
Answer
Read as: 2 + 3 × (4 − 1)^2 ÷ 9 − 1
Step by step
Parentheses, then addition and subtraction, left to right: 4 − 1 = 3 (the parentheses now hold one number, so they are removed)
2 + 3 × 3^2 ÷ 9 − 1
Exponents: 3^2 = 9
2 + 3 × 9 ÷ 9 − 1
Multiplication and division, left to right: 3 × 9 = 27
2 + 27 ÷ 9 − 1
Multiplication and division, left to right: 27 ÷ 9 = 3
2 + 3 − 1
Addition and subtraction, left to right: 2 + 3 = 5
5 − 1
Addition and subtraction, left to right: 5 − 1 = 4
4
PEMDAS, BODMAS, BIDMAS and BEDMAS all rank the operations the same way. Multiplication and division share a rank, as do addition and subtraction, so each pair is done left to right.
How to Use the Order of Operations Calculator
- 1. Type the expression. Use + − × ÷ and ^ for powers, with ( ), [ ] or { } for brackets. You can type * for × and / for ÷, and put a number straight before a bracket, as in 3(4 + 1).
- 2. Pick your mnemonic. PEMDAS, BODMAS, BIDMAS and BEDMAS rank the operations identically; the choice only changes the names used to label each step.
- 3. Choose how to read 2(3 + 4). By default a number touching a bracket is ordinary multiplication, done in its turn left to right. The alternative ranks it above division, which matters in expressions like 8 ÷ 2(2 + 2).
- 4. Follow the steps. Each line names the rule applied, shows the single operation done, and then the whole expression afterwards, until one number is left.
The Order, Tightest First
- Brackets (or parentheses), working from the innermost pair outward. Inside any bracket the same ranking applies.
- Exponents (also called orders or indices), from the top or the right: 2^3^2 is 2^(3^2) = 512.
- Multiplication and division, together, from left to right.
- Addition and subtraction, together, from left to right.
The mnemonics differ by country: PEMDAS (Parentheses, Exponents, Multiplication, Division, Addition, Subtraction) is common in the United States, while BODMAS, BIDMAS and BEDMAS (Brackets, Orders or Indices or Exponents, Division, Multiplication, Addition, Subtraction) are used in the UK, other Commonwealth countries and Canada. Their letter order is the trap. M comes before D in PEMDAS and D before M in BODMAS, yet both mean the same thing: multiplication and division have equal rank and are done left to right, and so are addition and subtraction. Germany’s version, “dot before dash” (Punkt vor Strich), avoids the problem.
| Expression | Left to right | Wrong reading | Wrong result |
|---|---|---|---|
| 8 ÷ 2 × 4 | (8 ÷ 2) × 4 = 16 | 8 ÷ (2 × 4) = 1 | 1 |
| 6 ÷ 2 × 3 | (6 ÷ 2) × 3 = 9 | 6 ÷ (2 × 3) = 1 | 1 |
| 10 − 4 + 2 | (10 − 4) + 2 = 8 | 10 − (4 + 2) = 4 | 4 |
| 100 ÷ 5 ÷ 2 | (100 ÷ 5) ÷ 2 = 10 | 100 ÷ (5 ÷ 2) = 40 | 40 |
Worked Example
The calculator opens on 2 + 3 × (4 − 1)^2 ÷ 9 − 1, which exercises every rule:
- Brackets: 4 − 1 = 3, and the brackets around the single number go. The expression is 2 + 3 × 3^2 ÷ 9 − 1.
- Exponents: 3^2 = 9, giving 2 + 3 × 9 ÷ 9 − 1.
- Multiplication and division, left to right: 3 × 9 = 27, then 27 ÷ 9 = 3, giving 2 + 3 − 1.
- Addition and subtraction, left to right: 2 + 3 = 5, then 5 − 1 = 4.
- The answer is 4.
Where Conventions Differ
- A minus sign before a power. In written mathematics −2² means −(2²) = −4, because the power is applied first. Excel treats the minus as tighter than the power, so =-2^2 returns 4. The calculator uses the mathematical reading and flags the case; type (−2)^2 for 4.
- Stacked powers. In printed superscripts, 2³² is read from the top down as 2^9 = 512. With a caret there is no universal rule: Google and Wolfram Alpha read 2^3^2 as 2^(3^2) = 512, while Excel reads (2^3)^2 = 64. This calculator uses 512.
- Implicit multiplication. 8 ÷ 2(2 + 2) is 16 if juxtaposition is ordinary multiplication and 1 if it ranks above division. Academic texts usually write 1/2x to mean 1/(2x), but many calculators read it as (1/2)x. When a result depends on the reading, the calculator shows both and suggests adding brackets.
Exact Fractions, No Rounding
Every number is held as an exact fraction, so 1 ÷ 3 × 3 is exactly 1, and 0.1 + 0.2 is exactly 0.3 — neither is the 0.30000000000000004 that floating-point arithmetic gives for the second. Intermediate fractions that do not terminate are shown in brackets, such as (1/3), and the final answer is given as a fraction, a mixed number and a decimal with its repeating block. Powers must come out exact, so 4^0.5 = 2 is accepted but 2^0.5, which is irrational, is not.
Frequently Asked Questions
- What is the order of operations?
- Brackets first, then exponents, then multiplication and division together from left to right, then addition and subtraction together from left to right. PEMDAS and BODMAS are two ways of remembering the same ranking.
- Is it PEMDAS or BODMAS?
- Both describe the same rules. PEMDAS is the usual name in the United States and BODMAS, BIDMAS or BEDMAS in the UK, Commonwealth countries and Canada. Brackets equal parentheses, and orders, indices and exponents are all the powers.
- Do you multiply before you divide?
- No. Multiplication and division have equal rank and are done in the order they appear, left to right. In 6 ÷ 2 × 3 you divide first and get 9; multiplying first would wrongly give 1. The same is true of addition and subtraction.
- Why does 8 ÷ 2(2 + 2) give different answers?
- Because the notation is ambiguous. Treating 2(2 + 2) as ordinary multiplication gives (8 ÷ 2) × 4 = 16; treating it as a single unit gives 8 ÷ 8 = 1. Good practice is to add brackets: 8 ÷ (2(2 + 2)) or (8 ÷ 2)(2 + 2).
- What is −2² — 4 or −4?
- Mathematically it is −4, since the exponent applies to 2 before the minus sign does. If you mean the square of negative two, write (−2)², which is 4. Some spreadsheets read −2^2 as 4, so use brackets when sharing formulas.
- Do I work the innermost brackets first?
- Yes. Evaluate the deepest pair, replace it with its value, and move outward. Inside each bracket the same ranking applies: exponents, then multiplication and division, then addition and subtraction.