Order of Operations Calculator: BEDMAS, PEMDAS and BODMAS Step by Step
By FindMySum · Last reviewed
The order of operations is the agreement that lets everyone read the same arithmetic expression the same way. Without it, 3 + 4 × 2 could be 14 (adding first) or 11 (multiplying first). Canadian students learn it as BEDMAS, American students as PEMDAS and students in the UK, India and Australia as BODMAS, but all three describe the same rule. This calculator works through any expression one operation at a time, shows which rule applies at each step, and keeps every value as an exact fraction. The opening example is 3 + 6 × (5 + 4) ÷ 3 − 7.
The rule
- Brackets: work out anything inside brackets first, starting with the innermost.
- Exponents: powers and roots.
- Division and Multiplication: together, from left to right.
- Addition and Subtraction: together, from left to right.
PEMDAS calls brackets "parentheses", BODMAS calls exponents "orders", and the D and M swap places, but none of that changes the order, because division and multiplication sit on the same level, as do addition and subtraction.
Worked example
Take the default expression:
3 + 6 × (5 + 4) ÷ 3 − 7
- B: the bracket first, 5 + 4 = 9, giving 3 + 6 × 9 ÷ 3 − 7.
- E: there are no exponents.
- D/M, left to right: 6 × 9 = 54, giving 3 + 54 ÷ 3 − 7; then 54 ÷ 3 = 18, giving 3 + 18 − 7.
- A/S, left to right: 3 + 18 = 21, then 21 − 7 = 14.
Five steps, and the calculator lists each one with the expression as it stands after that step.
The left-to-right pairs
The acronym's letters suggest that division comes before multiplication (BEDMAS) or multiplication before division (PEMDAS). Neither is true. They are a pair, done in the order they appear:
- 12 ÷ 3 × 2 = 4 × 2 = 8 (not 12 ÷ 6 = 2)
- 10 − 4 + 3 = 6 + 3 = 9 (not 10 − 7 = 3)
This is the mistake teachers see most often, and the reason many now write the acronym as B-E-DM-AS.
Exponents and negative numbers
An exponent applies only to what is directly in front of it. So:
- −2² = −(2²) = −4, because the power comes before the minus sign;
- (−2)² = 4, because the bracket makes −2 the base.
Powers stacked on powers are worked from the top down: 2^3^2 means 2^(3^2) = 2⁹ = 512, not (2³)² = 64. Spreadsheets such as Excel read −2^2 as 4, which is a common source of disagreement; this calculator follows the mathematical convention.
Brackets inside brackets
Square [ ] and curly { } brackets work exactly like round ones and are used to make nesting easier to see. Always start with the innermost:
[2 + {3 × (4 − 1)}] ÷ 2²
- 4 − 1 = 3
- 3 × 3 = 9
- 2 + 9 = 11
- 2² = 4
- 11 ÷ 4 = 11/4, which is 2 3/4 or 2.75.
Implied multiplication: the 6 ÷ 2(1 + 2) puzzle
A number written right next to a bracket means multiply: 2(1 + 2) is 2 × (1 + 2). Puzzles such as 6 ÷ 2(1 + 2) go viral because people disagree about whether that hidden multiplication should come before the division. This calculator, like the site's scientific calculator and most software, treats it as an ordinary multiplication worked left to right:
6 ÷ 2(1 + 2) = 6 ÷ 2 × 3 = 3 × 3 = 9
Some textbooks and older calculators give implied multiplication a higher priority and get 1. The honest answer is that the expression is ambiguous: mathematicians would write 6 ÷ (2 × 3) or (6 ÷ 2) × 3, or use a fraction bar, so the question never arises.
Fractions and decimals, exactly
Because division can create fractions, the calculator keeps every value as an exact fraction rather than a rounded decimal. 1/3 + 1/6 gives exactly 1/2, and 1/2 + 1/3 × 3/4 gives exactly 3/4 (the multiplication and divisions are worked left to right first: 1/3 × 3 = 1, 1 ÷ 4 = 1/4, then 1/2 + 1/4). The answer is shown as a fraction, a mixed number when it is larger than 1, and a decimal; repeating decimals such as 3/7 = 0.428571… are marked.
Tips for checking homework
- Rewrite the expression after every step, as the calculator does; most errors happen when a step is done in your head.
- Underline the operation you are about to do before you do it.
- When an expression could be read two ways, add brackets: they never change a correct answer and often prevent a wrong one.
- Estimate first. If 3 + 6 × 9 ÷ 3 − 7 should be about 3 + 18 − 7, an answer of 74 is a sign something went wrong.
More questions
When do Canadian students learn BEDMAS?
In Ontario's 2020 mathematics curriculum, students use the order of operations with whole numbers in Grade 6 and extend it to exponents, fractions and decimals in Grades 7 and 8. The Western and Northern Canadian Protocol framework used by the western provinces and territories introduces it at a similar stage. The acronym BEDMAS is the usual memory aid in both.
Does a basic phone calculator follow the order of operations?
Most modern phone calculators do: typing 3 + 4 × 2 gives 11. Some simple four-function calculators work immediately on each key press instead, so the same keys give 14. If in doubt, test with 3 + 4 × 2 and use brackets or the memory keys for anything longer.
Is there a mnemonic for remembering BEDMAS or PEMDAS?
In the US, 'Please Excuse My Dear Aunt Sally' is a classic for PEMDAS. Canadian teachers often just use the acronym, sometimes as 'Big Elephants Destroy Mice And Snails'. Whatever the phrase, remember that the D and M (and the A and S) are pairs done left to right, not one before the other.
How do fraction bars fit into the order of operations?
A long fraction bar acts as a bracket around the whole top and the whole bottom. (2 + 4) over (1 + 2) means (2 + 4) ÷ (1 + 2) = 2. When you type it on one line, add the brackets yourself; 2 + 4 ÷ 1 + 2 is 8, a completely different expression.
Where does the order of operations come from?
It grew out of algebraic notation in the 16th to 19th centuries, when writing 3x² + 2x needed an agreed reading. The conventions became standard in school textbooks in the early 20th century; the acronyms came later as teaching aids. Mathematicians follow the same rules but avoid ambiguous expressions such as a ÷ b(c) by using brackets or a fraction bar.
Sources
This article explains how the calculator works and is general information, not financial, tax, legal or medical advice. Rules change; check the sources above or a qualified professional before you act.