Order of Operations
PEMDAS and BODMAS are the same rule under two names. Here is what they mean, where they are commonly misread, and exactly how this calculator evaluates an expression.
Last updated: August 2026 · Written and verified by Akash Pandey
The rule
Without an agreed order, 2 + 3 × 4 could be 14 or 20. The convention that settles it is taught as PEMDAS in the United States and BODMAS or BIDMAS in Britain and much of the Commonwealth. The acronyms differ; the rule does not.
| Step | PEMDAS | BODMAS | Meaning |
|---|---|---|---|
| 1 | Parentheses | Brackets | Anything 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 |
So 8 ÷ 2 × 4 is 16, not 1 - you take the division first only because it comes first on the page, not because division outranks multiplication. Likewise 10 − 3 + 2 is 9, not 5.
Worked through, step by step
Evaluate 2 + 3 × 4²
2 + 3 × 4^2
- Exponents first:
4² = 16, leaving2 + 3 × 16. - Multiplication before addition:
3 × 16 = 48, leaving2 + 48. - Finally the addition.
= 50
- Exponents first:
Evaluate (6 + 2) × 3 − 4 ÷ 2
(6 + 2) × 3 - 4 ÷ 2
- Brackets first:
6 + 2 = 8, leaving8 × 3 − 4 ÷ 2. - Multiplication and division rank equally, so work left to right:
8 × 3 = 24. - Then
4 ÷ 2 = 2, leaving24 − 2.
= 22
- Brackets first:
Evaluate 100 ÷ 5 ÷ 2
100 ÷ 5 ÷ 2
- Both operations are division, so strictly left to right.
100 ÷ 5 = 20.20 ÷ 2 = 10. Reading right to left would give 40, which is wrong.
= 10
Evaluate 2 × (3 + (4 − 1)²)
2 × (3 + (4 - 1)^2)
- Work the innermost bracket first:
4 − 1 = 3. - Apply its exponent:
3² = 9. - Complete the outer bracket:
3 + 9 = 12. - Then the multiplication outside.
= 24
- Work the innermost bracket first:
The cases the acronyms do not cover
Unary minus binds looser than a power
−5² evaluates to −25, not 25. Exponentiation is applied before the negation, so the expression reads as "the negative of 5 squared". If you want the negative number squared, write (−5)². This is standard across mathematics and across essentially every calculator, but it surprises people constantly.
Stacked exponents group right to left
2^3^2 is 2^(3^2) = 2^9 = 512, not (2^3)^2 = 64. Exponentiation is the one common operator that associates right to left rather than left to right.
Implicit multiplication
This calculator accepts 2π and 3(4+1) without an explicit multiplication sign, treating them as multiplication at the normal multiplication precedence. Note that some handheld calculators give implicit multiplication a higher precedence, so that 6÷2(1+2) yields 1 on those machines and 9 here. There is no universal standard for this case - it is genuinely ambiguous notation, and the honest advice is to add brackets rather than rely on any particular machine's reading.
Functions apply to what follows them
sin(30) + 1 takes the sine of 30 and then adds 1. Because the argument is parenthesised there is no ambiguity - which is exactly why this calculator always inserts the opening bracket when you press a function key.
What this calculator actually does
Expressions are parsed by math.js, a well-established open-source expression parser, wrapped in a thin layer that handles the display symbols. The effective precedence, highest first:
| Precedence | Operators | Associativity |
|---|---|---|
| 1 (highest) | Parentheses, function calls | Innermost first |
| 2 | Factorial (n!), postfix percent (%) | Left to right |
| 3 | Exponentiation (^) | Right to left |
| 4 | Unary minus / plus | Right to left |
| 5 | Multiplication, division, modulo | Left to right |
| 6 (lowest) | Addition, subtraction | Left to right |
Frequently Asked Questions
Is PEMDAS or BODMAS correct?
Both. They are two mnemonics for the same convention. The apparent conflict between "MD" and "DM" does not matter, because multiplication and division rank equally and are worked left to right either way.
What is 8 ÷ 2 × 4?
16. Division and multiplication have equal precedence, so they are evaluated left to right: 8 ÷ 2 = 4, then 4 × 4 = 16.
Why does −5² give −25?
Exponentiation binds more tightly than the unary minus, so the expression means "the negative of 5²". Write (−5)² to square the negative number itself.
What is 6 ÷ 2(1 + 2)?
This calculator gives 9, treating implicit multiplication at normal multiplication precedence. Some handheld calculators give 1 by ranking implicit multiplication higher. The notation is genuinely ambiguous - use brackets to say which you mean.
Does the order of operations apply inside brackets too?
Yes. Within each bracket the same hierarchy applies, and nested brackets are resolved innermost first.