ORDER OF OPERATIONS (PEMDAS)

Arithmetic guide

Order of Operations (PEMDAS)

This guide explains each step, the left-to-right rule that trips most people up, the BODMAS and BIDMAS versions used outside the US, tricky cases like negative numbers and the viral 6 ÷ 2(1 + 2) problem, and practice questions with answers.

Updated

9 min read

Quick answer

The order of operations is the set of rules that tells you which part of a math expression to work out first. In the US it is remembered as PEMDAS: Parentheses, Exponents, Multiplication and Division (from left to right), then Addition and Subtraction (from left to right). Following it is why 2 + 3 × 4 equals 14, not 20: the multiplication comes before the addition.

The Order of Operations in 4 Steps

  1. Parentheses (and other grouping symbols). Work out everything inside ( ), [ ], { } and above or below a fraction bar first, starting with the innermost group.
  2. Exponents. Work out powers and roots, such as 32 or √16.
  3. Multiplication and division, left to right. They have equal rank. Do whichever comes first as you read from left to right.
  4. Addition and subtraction, left to right. They also have equal rank. Again, work from left to right.

Here is a quick example: 3 + 6 × (5 + 4) ÷ 3 − 7. Parentheses first: 5 + 4 = 9, giving 3 + 6 × 9 ÷ 3 − 7. Then multiplication and division from left to right: 6 × 9 = 54, then 54 ÷ 3 = 18, giving 3 + 18 − 7. Then addition and subtraction from left to right: 3 + 18 = 21, then 21 − 7 = 14.

What Is the Order of Operations?

The order of operations is an agreed convention for evaluating expressions that contain more than one operation. Without it, the same expression could give different answers depending on where you start. Take 2 + 3 × 4. Working left to right gives 5 × 4 = 20. Multiplying first gives 2 + 12 = 14. Mathematicians, scientists, calculators and programming languages all agree on 14, because they all follow the same order.

Think of it as grammar for math. Just as a sentence needs shared grammar rules to mean the same thing to every reader, an expression needs a shared order so that everyone who reads it gets the same result.

What Does PEMDAS Stand For?

PEMDAS is a memory aid for the order. Each letter is one step, and many students remember it with the phrase “Please Excuse My Dear Aunt Sally”.

LetterStands forWhat it coversExample
PParenthesesAll grouping symbols: ( ), [ ], { }, fraction bars, absolute value bars4 × (5 + 3) = 4 × 8 = 32
EExponentsPowers and roots2 + 32 = 2 + 9 = 11
M / DMultiplication and DivisionEqual rank, left to right24 ÷ 4 × 2 = 6 × 2 = 12
A / SAddition and SubtractionEqual rank, left to right10 − 4 + 3 = 6 + 3 = 9

The acronym hides one important detail. PEMDAS looks like six steps, but it is really four: M and D share a step, and A and S share a step. That is why some teachers write it as P, E, MD, AS. The next section explains why this matters so much.

The Left-to-Right Rule: The Most Common Mistake

Multiplication does not always come before division, and addition does not always come before subtraction. When operations share a rank, you do them in the order they appear, reading from left to right.

Multiplication and division: 24 ÷ 4 × 2. Reading left to right, the division comes first: 24 ÷ 4 = 6, then 6 × 2 = 12. Doing the multiplication first gives 24 ÷ 8 = 3, which is wrong.

Addition and subtraction: 10 − 4 + 3. Reading left to right, the subtraction comes first: 10 − 4 = 6, then 6 + 3 = 9. Doing the addition first gives 10 − 7 = 3, which is wrong.

A helpful way to see it: dividing by 4 is the same as multiplying by 1/4, and subtracting 4 is the same as adding −4. Once you rewrite division as multiplication and subtraction as addition, the order within each pair stops mattering.

PEMDAS vs BODMAS vs BIDMAS

Different countries teach different acronyms, but they all describe the same order and give the same answers. Only the words change: brackets instead of parentheses, and orders or indices instead of exponents.

AcronymStands forWhere it is used
PEMDASParentheses, Exponents, Multiplication/Division, Addition/SubtractionUnited States
BODMASBrackets, Orders, Division/Multiplication, Addition/SubtractionUnited Kingdom, India, Pakistan and many other countries
BIDMASBrackets, Indices, Division/Multiplication, Addition/SubtractionUnited Kingdom
BEDMASBrackets, Exponents, Division/Multiplication, Addition/SubtractionCanada, New Zealand
GEMDASGrouping, Exponents, Multiplication/Division, Addition/SubtractionSome US classrooms

BODMAS puts D before M, and PEMDAS puts M before D, but that difference does not matter: both pairs share a rank and are done left to right. GEMDAS uses “grouping” to remind you that fraction bars, brackets and absolute value bars count, not just round parentheses.

Worked Examples, Step by Step

Example 1: 8 + 2 × 5

There are no parentheses or exponents. Multiplication comes before addition: 2 × 5 = 10. Then 8 + 10 = 18. Compare (8 + 2) × 5, where the parentheses change the order: 10 × 5 = 50.

Example 2: 6 × (9 − 2) + 52

  1. Parentheses: 9 − 2 = 7, giving 6 × 7 + 52.
  2. Exponents: 52 = 25, giving 6 × 7 + 25.
  3. Multiplication: 6 × 7 = 42, giving 42 + 25.
  4. Addition: 42 + 25 = 67.

Example 3: 23 + 4 × (6 − 2)2 ÷ 8

  1. Parentheses: 6 − 2 = 4, giving 23 + 4 × 42 ÷ 8.
  2. Exponents: 23 = 8 and 42 = 16, giving 8 + 4 × 16 ÷ 8.
  3. Multiplication and division, left to right: 4 × 16 = 64, then 64 ÷ 8 = 8, giving 8 + 8.
  4. Addition: 8 + 8 = 16.

Example 4: Nested Brackets, 20 − [3 × (2 + 4)] ÷ 9

With brackets inside brackets, start with the innermost group and work outward. First 2 + 4 = 6. Then the square brackets: 3 × 6 = 18. Now the expression is 20 − 18 ÷ 9. Division before subtraction: 18 ÷ 9 = 2. Finally 20 − 2 = 18.

Example 5: A Fraction Bar, (12 + 8) ÷ (2 × 5)

A fraction bar acts as a grouping symbol: the whole top and the whole bottom are worked out before you divide. Written as a fraction, this is 12 + 8 over 2 × 5. The top is 20, the bottom is 10, and 20 ÷ 10 = 2. Typing 12 + 8 ÷ 2 × 5 without the parentheses would give 32, a completely different answer. The same rule applies when you work with fractions in the fraction calculator.

Exponents and Negative Numbers

Negative signs and exponents cause more lost marks than almost anything else. The rule is simple once you see it: an exponent applies only to what is directly in front of it.

  • −32 = −9. The exponent applies only to the 3, so this means −(3 × 3).
  • (−3)2 = 9. The parentheses put the negative sign inside, so this means (−3) × (−3).

Stacked exponents are worked from the top down, which means right to left. So 232 is 29 = 512, not 82 = 64. This is the one place where the order runs right to left instead of left to right.

Very large powers are easier to read in scientific notation, which the scientific notation calculator handles with the exponent rules shown here.

The Viral 6 ÷ 2(1 + 2) Problem

This expression goes viral every few years because people get two different answers: 9 and 1.

Under the standard order of operations, the answer is 9. Parentheses first: 1 + 2 = 3, giving 6 ÷ 2 × 3. Division and multiplication share a rank, so work left to right: 6 ÷ 2 = 3, then 3 × 3 = 9.

The answer 1 comes from a different habit called implied multiplication. Some people, some older textbooks and some calculators treat 2(1 + 2), written with no × sign, as a single unit that is worked out before the division. Under that reading, the expression becomes 6 ÷ 6 = 1.

The real lesson is that the expression is badly written. Anyone who means 1 should write 6 ÷ (2(1 + 2)), and anyone who means 9 should write (6 ÷ 2)(1 + 2). Mathematicians avoid this problem by using fraction bars and extra parentheses, so a reader never has to guess.

Order of Operations on Calculators, Excel and Code

Not every tool follows the rules in the same way, and knowing the differences saves you from wrong answers.

  • Scientific and graphing calculators follow the order of operations. Typing 2 + 3 × 4 gives 14.
  • Basic four-function calculators often work out each step as you press it, from left to right. Typing 2 + 3 × 4 on one of these can give 20. Use parentheses or the memory keys, or switch to a scientific calculator.
  • Excel and Google Sheets follow PEMDAS with one surprise: a leading minus sign is applied before the exponent. So =-3^2 returns 9, not −9. Write =-(3^2) when you mean −9.
  • Programming languages such as Python and JavaScript follow the standard order. In Python, -3**2 gives −9, and 2 + 3 * 4 gives 14.

When in doubt, add parentheses. Extra parentheses never change a correct answer, and they make your intent clear to any calculator, spreadsheet or reader.

Order of Operations in Everyday Life

You use the order of operations every time you work out a bill. Three shirts at $12 and two hats at $8 cost 3 × 12 + 2 × 8. The multiplications come first, $36 and $16, then the addition: $52 in total. Adding first would give a nonsense answer.

Discounts and tax follow the same logic. A $50 item with 20% off and then 8% sales tax costs 50 × (1 − 0.20) × 1.08 = $43.20, and the parentheses make sure the discount is worked out before the multiplication. The percentage calculator shows each of these steps. In algebra, the order of operations is also the reason expanding and factoring polynomials works: each step must respect which operations bind tighter.

Common Mistakes

MistakeWhat goes wrongDo this instead
Always multiplying before dividing24 ÷ 4 × 2 is answered as 3Work left to right: 24 ÷ 4 = 6, then 6 × 2 = 12
Always adding before subtracting10 − 4 + 3 is answered as 3Work left to right: 10 − 4 = 6, then 6 + 3 = 9
Squaring the negative sign−32 is answered as 9The exponent applies to 3 only: −32 = −9
Ignoring the fraction bar(12 + 8) over (2 × 5) is typed as 12 + 8 ÷ 2 × 5 = 32Treat the top and bottom as groups: 20 ÷ 10 = 2
Working left to right through everything2 + 3 × 4 is answered as 20Multiplication first: 2 + 12 = 14

Practice Problems With Answers

Work each one on paper, writing a new line after every step. Then check the answers.

  1. 7 + 3 × 4. Answer: 19.
  2. 18 ÷ 3 × 2. Answer: 12.
  3. 52 − 3 × 4. Answer: 13.
  4. (15 − 3) ÷ (2 + 4) + 6. Answer: 8.
  5. 40 − 2 × (3 + 5)2 ÷ 4. Answer: 8.
  6. 2 × [3 + (4 × 2)]. Answer: 22.
  7. 9 − 32 + 12 ÷ 4 × 2. Answer: 6.
  8. −22 + (−2)2. Answer: 0. The first term is −4 and the second is 4.

Frequently Asked Questions

What is the correct order of operations?

Parentheses first, then exponents, then multiplication and division from left to right, then addition and subtraction from left to right. In the US this is remembered as PEMDAS, and in many other countries as BODMAS or BIDMAS.

Does multiplication come before division in PEMDAS?

No. Multiplication and division have equal rank, so you do whichever comes first from left to right. For 24 ÷ 4 × 2, the division comes first: 24 ÷ 4 = 6, then 6 × 2 = 12.

What is the difference between PEMDAS and BODMAS?

Only the words. PEMDAS says parentheses and exponents, while BODMAS says brackets and orders. Both describe the same order and always give the same answer, because multiplication/division and addition/subtraction are done left to right in both.

What does “Please Excuse My Dear Aunt Sally” mean?

It is a phrase that helps you remember PEMDAS. Each word starts with the letter of one step: Parentheses, Exponents, Multiplication, Division, Addition, Subtraction. “Dear Aunt Sally” is not a strict order, since M and D, and A and S, are done left to right.

What is the answer to 6 ÷ 2(1 + 2)?

Under the standard order of operations, the answer is 9: 6 ÷ 2 × 3, worked left to right. Some people get 1 because they treat 2(1 + 2) as a single unit. The expression is ambiguous, which is why it should be written with clearer parentheses.

Is −3² equal to 9 or −9?

It is −9, because the exponent applies only to the 3, not to the negative sign. If you want to square −3, write (−3)², which equals 9.

Do square roots count as exponents in PEMDAS?

Yes. Roots are worked out in the exponents step, because a square root is the same as a power of one half. The radical sign also acts like a grouping symbol, so everything under it is worked out first: √(9 + 16) = √25 = 5.

Why do we need an order of operations?

So that every expression has exactly one correct answer. Without an agreed order, 2 + 3 × 4 could be 14 or 20 depending on where you start. The convention lets people, calculators and computers all read math the same way.

Key Takeaways

  • The order is parentheses, exponents, multiplication and division, then addition and subtraction.
  • PEMDAS has four steps, not six: multiplication and division share a rank, and so do addition and subtraction.
  • Within a shared rank, always work left to right.
  • PEMDAS, BODMAS, BIDMAS and BEDMAS are the same rules with different names.
  • An exponent applies only to what is directly in front of it: −3² = −9, but (−3)² = 9.
  • Fraction bars and radicals are grouping symbols, and extra parentheses always make your meaning clear.

Further reading: Math is Fun: Order of Operations and Essentials of Mathematics (MTSU): Order of Operations.

About the author