The order of operations is the convention that decides which part of an expression to evaluate first. Without it, 12 + 7 × 3 could read as 33 or 57. The rule says 33, because multiplication happens before addition. PEMDAS and BODMAS teach the same rule under two names, and any expression parser, including the one on this calculator, applies it every time you press =.
Key Takeaways
12 + 7 × 3 = 33; add brackets and(12 + 7) × 3 = 57.- Powers bind right to left:
2^3^2 = 512, while(2^3)^2 = 64.- Unary minus binds looser than a power:
−5^2 = −25, not 25.- Postfix percent adds its share of the earlier value:
200 + 10% = 220.
The rule in one table
The steps, taught as PEMDAS in the United States and BODMAS or BIDMAS in Britain and much of the Commonwealth, are:
| Step | PEMDAS | BODMAS | Meaning |
|---|---|---|---|
| 1 | Parentheses | Brackets | Everything grouped, innermost first |
| 2 | Exponents | Orders / Indices | Powers and roots |
| 3 | Multiplication & Division | Division & Multiplication | Equal rank, left to right |
| 4 | Addition & Subtraction | Addition & Subtraction | Equal rank, left to right |
The most common misreading treats the acronym as four strict levels. It is not. Multiplication does not outrank division, and addition does not outrank subtraction. Each pair shares a rank and is worked left to right, which is why PEMDAS and BODMAS give identical answers even though they list M and D in opposite orders. The order of operations guide walks through the same table with work shown step by step.
Worked example 1: the classic trap
The wrong reading. 12 + 7 × 3, calculated strictly left to right, gives 19 × 3 = 57. That is not what the rule says.
The right reading. Multiplication first: 7 × 3 = 21, then 12 + 21 = 33.
Type 12+7*3 and the calculator returns 33. To force your own ordering, use brackets: (12+7)*3 returns 57. The calculator follows the math, not the order you typed. The same logic applies in reverse: 100 * 2 + 3 is 203, while 100 * (2 + 3) is 500.
Where the acronyms leave gaps
The four letters cover the basics, but three common cases sit outside them and trip people up on calculators.
Stacked exponents group right to left
Exponentiation is the one operator that associates right to left. 2^3^2 means 2^(3^2) = 2^9 = 512, not (2^3)^2 = 64. The difference is large, so write the brackets explicitly. The exponents explained post goes deeper into this habit.
Percent is a postfix operator
The % key does not simply divide by 100 when you attach it after a plus or minus. In 200 + 10%, the calculator reads the percent as a share of the earlier value: 200 × (1 + 0.1) = 220. Likewise 100 - 20% gives 80, and 50 + 10% gives 55. When you want 10 percent of 200 as a standalone number, type 200*10% and it returns 20.
Implicit multiplication sits at the ordinary rank
This calculator accepts 2π and 3(4+1) without a times sign and treats them as ordinary multiplication. Some handheld calculators rank implicit multiplication higher, so 6÷2(1+2) gives 1 on those machines and 9 here. There is no universal standard for that case. The honest fix is brackets. The percentage guide and the getting started guide cover the two most common slip ups in daily use.
The precedence rules this calculator applies
Expressions run through the math.js parser, and the effective priority, highest first, is:
| Precedence | Operators | Associativity |
|---|---|---|
| 1 (highest) | Brackets and function calls | Innermost first |
| 2 | Factorial n!, postfix percent % |
Left to right |
| 3 | Exponentiation ^ |
Right to left |
| 4 | Unary minus and plus | Right to left |
| 5 | Multiplication, division, modulo | Left to right |
| 6 (lowest) | Addition, subtraction | Left to right |
Worked example 2: 2 + 3 × 4²
Follow the table top to bottom. Brackets: none. Powers: 4² = 16. Multiplication: 3 × 16 = 48. Addition: 2 + 48 = 50. Type 2+3*4^2 and you get 50. If an expression refuses to parse, the error message guide explains what each message means and how to fix the brackets.
Worked example 3: 200 + 10%
The percent applies at step 2 in the table, after brackets and before multiplication. So 200 + 10% is evaluated as 200 × (1 + 0.10) = 220. Type 200+10% and the calculator returns 220. This shorthand is why 100 - 20% reads as a 20 percent discount: 100 × (1 − 0.2) = 80.
Frequently asked questions
Is PEMDAS or BODMAS correct?
Both. They are two mnemonics for the same convention. The D and M order does not matter because multiplication and division rank equally and are worked left to right either way.
What is 8 ÷ 2 × 4?
- Division and multiplication share a rank, so evaluate left to right:
8 ÷ 2 = 4, then4 × 4 = 16.
What is 200 + 10%?
- The percent is taken as a share of the earlier value, so the expression means
200 × (1 + 0.1). To get a tenth of 200 on its own, type200*10%, which returns 20.
Why does −5² give −25?
Exponentiation binds tighter than the unary minus, so −5^2 reads as the negative of 5². Write (−5)^2 to square the negative number itself; that gives 25.
What is 6 ÷ 2(1 + 2)?
This calculator gives 9, treating implicit multiplication at the ordinary multiplication rank. Some handheld calculators give 1 by raising that rank. The notation is ambiguous, so the safe answer is to use brackets.