Skip to content
Article · 7 min read

The order of operations

BIDMAS, PEMDAS, BODMAS — same rule, four acronyms. Here is what it really says.

Why we need a convention

Without an agreed order, an expression like 2 + 3 × 4 is ambiguous. Should you read it left to right and get 20, or do the multiplication first and get 14? Maths picked the second answer by convention, and the convention is so important that it has spawned a small library of acronyms.

The rule, in plain English

  1. Brackets / parentheses first.
  2. Indices (powers and roots) next.
  3. Multiplication and division, in the order they appear from left to right.
  4. Addition and subtraction, in the order they appear from left to right.

The acronyms BIDMAS, BODMAS (UK), and PEMDAS (US) all encode the same rule. The single most-misunderstood point is that multiplication and division share a level, and so do addition and subtraction. They are read left to right, not in the order the acronym appears to suggest.

Worked examples

  • 2 + 3 × 4 = 2 + 12 = 14 (not 20).
  • 8 − 3 + 2 = 5 + 2 = 7 (not 3). Subtraction is left to right.
  • 16 ÷ 4 × 2 = 4 × 2 = 8 (not 2). Multiplication and division are left to right.
  • 2^3^2 = 2^(3^2) = 2⁹ = 512. Exponents associate right to left, which is one of the few exceptions to the left-to-right rule.
  • (2 + 3) × 4 = 5 × 4 = 20. Parentheses overrule everything.

The viral examples

Every few years a Twitter post asks "what is 6 ÷ 2(1 + 2)" and the internet melts down. The answer using strict left-to-right order is (6 ÷ 2)(3) = 9, but a non-trivial number of people read the implicit multiplication 2(1+2) as a higher-priority unit and get 1. Mathematically the question is poorly written; in any well-typeset textbook a fraction bar would resolve the ambiguity. The lesson: when in doubt, add brackets. Our scientific calculator deliberately treats implicit multiplication as the same precedence as explicit multiplication, matching how computer algebra systems work.

How to never get this wrong again

  • When you write maths down, use brackets liberally. Saving a few keystrokes is not worth a wrong answer.
  • When you read someone else's maths, mentally insert the brackets the order of operations implies before you start computing.
  • If a calculator gives you an unexpected answer, retype the expression with extra brackets and see if it changes.