PEMDAS Calculator

This PEMDAS calculator solves any expression in the correct order and names each step as it goes, so you can see where the mnemonic helps and where it misleads. The box starts on 8 ÷ 2(2 + 2), the problem that keeps restarting the argument.

PEMDAS calculatorLive — updates as you type
Type the problem exactly as it is written. Use ^ for exponents.

How to use the PEMDAS calculator

  1. Type the problem exactly as it is written, including any brackets. Use ^ for exponents.
  2. Watch the answer at the top change as you type; there is no button to press.
  3. Read the steps below it. Each one names the operation, so you can match it against the letter of PEMDAS you were expecting.
  4. If the expression has no brackets and a straight left-to-right reading gives something different, that answer appears too, labelled as the wrong one.

The same engine drives the order of operations calculator, which goes deeper into the rules themselves. This page is about the acronym, what it hides, and the problems people fight about.

What each letter of PEMDAS stands for

P · E · MD · AS
Parentheses, Exponents, Multiplication and Division together, Addition and Subtraction together. Four ranks, not six letters.
  • P — Parentheses. Anything inside brackets is finished first, innermost pair before outer. Square brackets and braces count as parentheses.
  • E — Exponents. Powers and roots. A stack of exponents is worked from the top down.
  • M and D — Multiplication and Division. One rank. Work left to right through whichever you meet first.
  • A and S — Addition and Subtraction. Also one rank, also left to right.

The letters are in a sensible order and the first two are unambiguous. The trouble starts at the third, because the acronym prints four letters where the rule only has two ranks.

The part the mnemonic gets wrong

“Please Excuse My Dear Aunt Sally” reads like six instructions in a queue: multiply, then divide, then add, then subtract. That is not the rule, and following it as written produces wrong answers on some very ordinary expressions.

MD is one step and AS is one stepMultiplication does not come before division, and addition does not come before subtraction. Within each of those two ranks you work strictly left to right.

Example: 24 ÷ 6 × 2

Aunt Sally says multiply first: 6 × 2 = 12, then 24 ÷ 12 = 2. That is wrong.

24 ÷ 6 = 4 division comes first because it is further left 4 × 2 = 8

The answer is 8.

Example: 18 − 6 + 3

Doing the addition first because A comes before S gives 6 + 3 = 9, then 18 − 9 = 9. Also wrong.

18 − 6 = 12 subtraction comes first because it is further left 12 + 3 = 15

The answer is 15.

A more reliable way to say it: multiplication and division bind numbers into terms, and addition and subtraction join finished terms together. In 18 − 6 + 3 the terms are 18, −6 and +3, and they can be added in any order because each one keeps its own sign.

Two full worked examples

Example: 7 + 6 × (5 + 3) ÷ 2

5 + 3 = 8 P — parentheses 6 × 8 = 48 MD — leftmost of the pair 48 ÷ 2 = 24 MD — next one along 7 + 24 = 31 AS

The answer is 31. There are no exponents, so E is skipped, and the M and the D happen in the order they appear rather than M first.

Example: 5 × 2^3 − (9 − 4)

9 − 4 = 5 P — parentheses, even though they sit at the end 2 ^ 3 = 8 E — exponents 5 × 8 = 40 MD 40 − 5 = 35 AS

The answer is 35. Parentheses are done first no matter where in the line they appear, which is the one part of the acronym that is safe to take literally.

PEMDAS, BODMAS, BIDMAS and BEDMAS

Different countries teach the same rule under different initials. None of them changes a single answer. If you were taught one and are reading material that uses another, this is the whole of the difference.

AcronymFirstSecondThirdFourth
PEMDASParenthesesExponentsMultiplication / DivisionAddition / Subtraction
BODMASBracketsOrdersDivision / MultiplicationAddition / Subtraction
BIDMASBracketsIndicesDivision / MultiplicationAddition / Subtraction
BEDMASBracketsExponentsDivision / MultiplicationAddition / Subtraction
GEMSGroupingExponentsMultiplication / DivisionSubtraction / Addition

“Parentheses” and “brackets” are the same thing. “Orders”, “indices” and “exponents” are all names for powers. The only visible disagreement is that PEMDAS puts M before D while BODMAS and BIDMAS put D before M — and because those two are one rank worked left to right, the swap makes no difference to any answer.

That is also the strongest argument for the GEMS version: with only four letters, it cannot suggest an order that does not exist. “Grouping” is arguably the better word too, since brackets, fraction bars and absolute value bars all group in exactly the same way.

8 ÷ 2(2 + 2) and the problems that go viral

Every so often an expression like 8 ÷ 2(2 + 2) circulates with two camps insisting on 16 and on 1. Both camps can do arithmetic. The disagreement is about notation, not about PEMDAS.

Everyone agrees the brackets go first, giving 8 ÷ 2(4). The question is what 2(4) is. If the implied multiplication is an ordinary multiplication, it shares a rank with the division and you work left to right: 8 ÷ 2 = 4, then 4 × 4 = 16. If juxtaposition binds tighter than an explicit ÷ — a convention common in algebra, where 1/2x is usually read as 1/(2x) — then 2(4) = 8 is a single term and the answer is 8 ÷ 8 = 1.

What this calculator doesImplicit multiplication is treated as ordinary multiplication, at the same rank as × and ÷. So 8 ÷ 2(2 + 2) gives 16 and 6 ÷ 2(1 + 2) gives 9. That matches the convention taught in most schools, and it is the reading that most programming languages use.

The honest answer is that the expression is badly written. There is no universal standard that settles higher-priority juxtaposition, which is why competent people and reputable calculators land on both answers. Style guides for scientific writing avoid the situation entirely by never putting a division sign in front of a product.

The fix takes one extra bracket, and it removes the argument completely.

(8 ÷ 2)(2 + 2) = 16 unambiguous 8 ÷ (2(2 + 2)) = 1 unambiguous 6 ÷ 2 × (1 + 2) = 9 writing the × in makes it ordinary multiplication

If a problem’s answer depends on which convention the reader uses, the problem is the thing that needs fixing. Write the brackets, or use a fraction bar, which groups the numerator and denominator visually and leaves nothing to interpret.

How to check an answer reliably

The mnemonic is a memory aid, not a method. These habits catch more errors than reciting it does.

  • Underline the terms first. Mark every multiplication, division and exponent group before you add anything. What is left is a simple sum of finished terms.
  • Say “multiply and divide” as one phrase. Same for “add and subtract”. If you can stop hearing them as four separate steps, the 24 ÷ 6 × 2 trap disappears.
  • Rewrite division as a fraction. Stacking the numerator over the denominator removes the ambiguity that the ÷ sign creates.
  • Add brackets you do not strictly need. No one has ever been marked down for writing (3 × 4) + 2.
  • Watch signs on exponents. −3² is −9 and (−3)² is 9. The calculator follows that convention: -3^2 gives −9 and (-3)^2 gives 9.
  • Estimate the size first. 7 + 6 × 8 ÷ 2 contains a term worth 24, so the answer should be in the thirties. Getting 52 means the 7 was folded in too early.
  • Check a single step in isolation. When one division inside a long line is the doubtful part, the division calculator will show that step’s working on its own.

Expressions that also involve absolute value bars follow the same grouping logic; the absolute value calculator works through what happens inside the bars before the sign is dropped.

Frequently asked questions

What is 8 ÷ 2(2 + 2)?

This calculator gives 16. Brackets first: 2 + 2 = 4. Then, treating 2(4) as ordinary multiplication at the same rank as the division, work left to right: 8 ÷ 2 = 4, then 4 × 4 = 16. Readers who treat 2(4) as one bound term get 1 instead. The expression is genuinely ambiguous, so add brackets.

What is 6 ÷ 2(1 + 2)?

It is 9 under the convention used here. The brackets give 3, then 6 ÷ 2 = 3, then 3 × 3 = 9. The competing answer of 1 comes from reading 2(1 + 2) as a single term of 6. Writing it as (6 ÷ 2) × 3 or as 6 ÷ (2 × 3) settles it either way.

Does PEMDAS mean multiplication always comes before division?

No, and this is the most common misreading of the acronym. M and D are one rank, worked left to right. 24 ÷ 6 × 2 is 8, because the division is further left, not 2. The same applies to A and S: 18 − 6 + 3 is 15, not 9.

Are PEMDAS and BODMAS different rules?

They are the same rule with different initials. Parentheses and brackets are the same thing, and orders, indices and exponents all mean powers. PEMDAS lists M before D and BODMAS lists D before M, but since that pair is one rank worked left to right, no answer ever changes.

What is 7 + 6 × (5 + 3) ÷ 2?

The answer is 31. Parentheses first: 5 + 3 = 8. Then the multiplication and division in reading order: 6 × 8 = 48, then 48 ÷ 2 = 24. Finally the addition: 7 + 24 = 31. Adding the 7 first would have given a much larger answer.

Why do people get different answers to the same problem?

Almost always for one of two reasons. Either they treated MD or AS as two ranks instead of one, which is a mistake, or the expression contains implicit multiplication after a division sign, which is a real ambiguity in notation. The second kind is not settled by any acronym.

Is there a better mnemonic than Aunt Sally?

GEMS is harder to misread: Grouping, Exponents, Multiplication and division, Subtraction and addition. Four letters for four ranks means it cannot imply an order between M and D. Writing PEMDAS as P, E, MD, AS with the pairs joined does the same job for the acronym you already know.

Does the rule change once you get to algebra?

The ranks stay the same, but notation gets tighter. Algebra rarely uses a ÷ sign, preferring fraction bars, which group the top and bottom automatically. It also relies on juxtaposition, so 2x is read as one term. Those habits are exactly why the viral division problems cannot happen in real mathematical writing.

Put this calculator on your own site (free)

Copy this into any page. The calculator stays up to date on its own, works on mobile, and carries a small credit link back here.

Preview it
Cite this page “PEMDAS Calculator”. Four Function Calculator, 6 September 2026.https://fourfunctioncalculator.com/pemdas-calculator/
Shows the workingRuns entirely in your browser — nothing you type is sent anywhere.Last reviewed 6 September 2026