---
title: "BODMAS Rule Explained: The Left to Right Step"
description: "BODMAS explained with worked examples: what each letter means, the left to right rule most people miss, PEMDAS vs BIDMAS, and why 6/2(1+2) is argued."
slug: bodmas-rule-explained
canonical: https://learn.modernagecoders.com/blog/bodmas-rule-explained/
date: 2026-09-28
dateModified: 2026-09-28
category: "Mathematics"
tags: ["Maths", "BODMAS", "Order of Operations", "Students"]
keywords: ["bodmas rule", "bodmas", "what does bodmas stand for", "pemdas", "bidmas", "order of operations", "bodmas questions with answers", "6/2(1+2)"]
readTime: "9 min read"
author: "Modern Age Coders Team"
---
# BODMAS Rule Explained, With Worked Examples

> What each letter means, the left to right rule that causes most mistakes, and why 6 / 2(1 + 2) keeps going viral.

![BODMAS rule shown as four levels: brackets, orders, division and multiplication, addition and subtraction](/images/blog/bodmas-rule-explained/00-hero.png)

*By Modern Age Coders Team · 2026-09-28 · 9 min read*

**Quick answer:** BODMAS stands for Brackets, Orders (powers and roots), Division, Multiplication, Addition and Subtraction, and it tells you which part of a calculation to do first. It has four levels, not six: division and multiplication share a level, as do addition and subtraction, and within a level you work left to right. So 10 - 3 + 2 is 9 and 24 / 4 x 2 is 12. PEMDAS, BIDMAS and BEDMAS are the same rule under different names.

BODMAS is the rule that tells you which part of a calculation to do first. Without it, 3 + 4 x 2 could be 14 or 11 depending on who is reading. With it, everyone gets 11. It is one of the first "rules" children meet in maths, and one of the most commonly misunderstood, including by adults who learned it years ago.

This guide explains what each letter means, the one detail that causes most BODMAS mistakes, how it relates to PEMDAS and BIDMAS, and why expressions like 6 ÷ 2(1 + 2) start arguments online. Every calculation is worked through step by step, and the examples were checked by running them in Python, which follows the same rule.

## What BODMAS stands for

- **B: Brackets.** Anything inside brackets is worked out first. If brackets are nested, start with the innermost.
- **O: Orders.** Powers and roots, such as 3 squared or the square root of 16. Some teachers say "Of", as in "half of 20", which is really a multiplication.
- **D and M: Division and Multiplication.** These are one level. Do whichever comes first, reading from left to right.
- **A and S: Addition and Subtraction.** Also one level. Again, left to right.

![BODMAS, BIDMAS, PEMDAS and BEDMAS compared, with the countries that use each and what the letters stand for](/images/blog/bodmas-rule-explained/01-names.png)

*Different countries, different acronyms, identical rule.*

If you went to school in the United States you probably learned PEMDAS (Parentheses, Exponents, Multiplication, Division, Addition, Subtraction), sometimes remembered as "Please Excuse My Dear Aunt Sally". In Canada it is often BEDMAS, and in the UK both BODMAS and BIDMAS (I for Indices) are common. They all describe the same rule. The different letter orders, D before M or M before D, change nothing, because those two operations share a level.

## The detail that causes most mistakes: left to right

An acronym is a list, and a list suggests an order. So many students read BODMAS as six steps: first all the division, then all the multiplication, then all the addition, then all the subtraction. That reading gives wrong answers.

![Two ways of working out 10 - 3 + 2: doing addition first gives 5, which is wrong; working left to right gives 9, which is correct](/images/blog/bodmas-rule-explained/02-left-to-right.png)

*The acronym lists A before S. The rule treats them as equals.*

Here are two pairs that show the difference. Python follows the real rule, so its output shows the correct answers next to the answers the six-step reading would give:

**left_to_right.py**

```python
print("10 - 3 + 2      =", 10 - 3 + 2)      # left to right
print("10 - (3 + 2)    =", 10 - (3 + 2))    # what you get if + wrongly goes first
print("24 / 4 * 2      =", 24 / 4 * 2)      # left to right
print("24 / (4 * 2)    =", 24 / (4 * 2))    # what you get if x wrongly goes first
```

**Output**

```text
10 - 3 + 2      = 9
10 - (3 + 2)    = 5
24 / 4 * 2      = 12.0
24 / (4 * 2)    = 3.0
```

The first line of each pair is right. 10 - 3 + 2 means "start with 10, take away 3, then add 2", which is 9. Subtraction is really adding a negative number: 10 + (-3) + 2. Seen that way, it is obvious that the order does not matter and there is no reason to do the + first. The same goes for division and multiplication: 24 ÷ 4 x 2 is 24 x 1/4 x 2, which is 12.

> **A better way to remember it**

> Draw BODMAS as four steps, not six: B, then O, then DM together, then AS together. Write "left to right" next to the last two. Children who learn it this way almost never make the 10 - 3 + 2 mistake.

## A worked example, one step at a time

Let us work through 3 + 4 x 2² - (6 - 1) ÷ 5. It has every level in it. Rather than just claim the answer, here is a short Python program that performs one operation at a time, choosing the next step using exactly the BODMAS rule, and prints the expression after each one. In Python, ** means "to the power of".

**bodmas_steps.py**

```python
import ast

RANK = {ast.Pow: 3, ast.Mult: 2, ast.Div: 2, ast.Add: 1, ast.Sub: 1}

def ready(node):
    return isinstance(node, ast.BinOp) and all(isinstance(x, ast.Constant) for x in (node.left, node.right))

def pick(tree):
    """Brackets first, then powers, then x and / from the left, then + and - from the left."""
    best = None
    parent = {child: node for node in ast.walk(tree) for child in ast.iter_child_nodes(node)}
    for node in ast.walk(tree):
        if ready(node):
            up = parent.get(node)
            in_brackets = isinstance(up, ast.BinOp) and RANK[type(up.op)] > RANK[type(node.op)]
            key = (-(4 if in_brackets else RANK[type(node.op)]), node.col_offset)
            if best is None or key < best[0]:
                best = (key, node)
    return best[1] if best else None

class Fold(ast.NodeTransformer):
    def __init__(self, target): self.target = target
    def visit_BinOp(self, node):
        self.generic_visit(node)
        if node is self.target:
            value = eval(compile(ast.Expression(node), "", "eval"))
            if isinstance(value, float) and value.is_integer():
                value = int(value)
            return ast.copy_location(ast.Constant(value), node)
        return node

def show_steps(expression):
    tree = ast.parse(expression, mode="eval")
    print(expression)
    while (node := pick(tree)) is not None:
        tree = ast.fix_missing_locations(Fold(node).visit(tree))
        tree = ast.parse(ast.unparse(tree), mode="eval")   # re-parse so positions stay honest
        print("=", ast.unparse(tree))

show_steps("3 + 4 * 2 ** 2 - (6 - 1) / 5")
```

**Output**

```text
3 + 4 * 2 ** 2 - (6 - 1) / 5
= 3 + 4 * 2 ** 2 - 5 / 5
= 3 + 4 * 4 - 5 / 5
= 3 + 16 - 5 / 5
= 3 + 16 - 1
= 19 - 1
= 18
```

![Step by step BODMAS evaluation of 3 + 4 x 2 squared minus (6 - 1) divided by 5, reaching 18](/images/blog/bodmas-rule-explained/03-worked.png)

*Brackets, then the power, then x and / from the left, then + and - from the left.*

1. **Brackets:** (6 - 1) becomes 5.
2. **Orders:** 2 squared becomes 4.
3. **Division and multiplication, left to right:** 4 x 4 is 16, then 5 ÷ 5 is 1.
4. **Addition and subtraction, left to right:** 3 + 16 is 19, then 19 - 1 is 18.

Writing one line per step, as the program does, is the single best habit for avoiding BODMAS mistakes by hand. Most errors happen when a student tries to do two steps in their head at once.

## Why 6 ÷ 2(1 + 2) starts arguments

Every few months a picture goes viral asking for the answer to 6 ÷ 2(1 + 2), and people split between 9 and 1. Both camps are following a rule. The disagreement is about how to read the expression, not about BODMAS.

![The viral expression 6 divided by 2(1 + 2) read two ways: as (6 divided by 2) times 3, giving 9, or as 6 divided by (2 times 3), giving 1](/images/blog/bodmas-rule-explained/04-viral.png)

*Both readings are rule-following. The expression itself is the problem.*

Under the standard rule, the brackets give 3, and then 6 ÷ 2 x 3 is worked left to right, giving 9. That is what Python gives, and it is what most modern calculators and textbooks would give too. But some people treat a number written directly against a bracket, 2(1 + 2), as a single glued-together term that should be worked out before the division. Read that way, the answer is 1. Some older textbooks and some calculators follow that convention.

**viral.py**

```python
print("6 / 2 * (1 + 2) =", 6 / 2 * (1 + 2))
print("6 / (2 * (1 + 2)) =", 6 / (2 * (1 + 2)))
print("-3 ** 2 =", -3 ** 2, "   (the power happens before the minus sign)")
print("(-3) ** 2 =", (-3) ** 2)
```

**Output**

```text
6 / 2 * (1 + 2) = 9.0
6 / (2 * (1 + 2)) = 1.0
-3 ** 2 = -9    (the power happens before the minus sign)
(-3) ** 2 = 9
```

The honest answer is that the expression is badly written. No mathematician, scientist or programmer would write it that way when it mattered. They would write (6 ÷ 2)(1 + 2) or use a fraction bar so there is nothing to argue about. That is the real lesson for students: when your own working could be read two ways, add brackets.

> **Spreadsheets do not always agree either**

> The last two lines of the output show a related trap. In Python and in standard maths, -3 squared means -(3 squared), which is -9. In Microsoft Excel, typing =-3^2 gives 9, because Excel applies the minus sign before the power. If you use spreadsheets for schoolwork or at work, write =-(3^2) or =(-3)^2 so the meaning is clear.

## BODMAS in programming

Every programming language has its own version of BODMAS, called operator precedence, and for ordinary arithmetic it matches the maths rule. That is why code written by beginners so often has too few brackets: it works most of the time, until it does not. Two differences are worth knowing early. Python uses ** for powers rather than ^, which means something else entirely. And Python has extra operators, such as // for floor division and % for remainders, that sit on the same level as multiplication and division. Our guide to [floor division in Python](/blog/what-is-floor-division-in-python) covers those.

It is one of many places where learning to code sharpens maths and the other way round, which is the idea behind [teaching coding and maths together](/why-coding-and-maths-together).

## Practice questions with answers

Try these without a calculator, writing one line per step. The answers below were checked by Python.

| Question | Answer | Why |
| --- | --- | --- |
| 8 + 2 x 5 | 18 | Multiply before adding |
| (8 + 2) x 5 | 50 | Brackets first |
| 20 - 6 ÷ 3 | 18 | Divide before subtracting |
| 18 ÷ 3 x 2 | 12 | Same level, left to right |
| 2 + 3² | 11 | The power before the addition |
| 50 - 10 - 5 | 35 | Left to right, not 50 - 5 |
| 4 x (6 - 2)² | 64 | Brackets, then the power, then multiply |
| 100 ÷ 10 ÷ 2 | 5 | Left to right, not 100 ÷ 5 |

If your child gets question 4, 6 or 8 wrong, they are almost certainly using the six-step reading. Go back to the four-level ladder. For more ways to build confidence with numbers, see our [mental maths tricks with worked examples](/blog/mental-maths-tricks-for-kids).

## How we teach it

In our [live online maths classes](/online-maths-tuition), students are encouraged to work out why a rule has to be the way it is before they rely on it, which is why the left to right idea gets as much attention as the acronym. Mistakes are treated as clues rather than failures. Our [how we teach](/how-we-teach) page explains the approach. Classes are one to one or in small groups of 5 to 10, for learners from 6 to 67.

[Book a free maths class](/book-demo) [Book a priority demo](/book-demo)

## Frequently asked questions

**What does BODMAS stand for?**

Brackets, Orders, Division, Multiplication, Addition and Subtraction. Orders means powers and roots. Division and multiplication share one level, and addition and subtraction share another, so within each level you work from left to right.

**Is it BODMAS or PEMDAS?**

They are the same rule with different names. PEMDAS is used mainly in the United States and stands for Parentheses, Exponents, Multiplication, Division, Addition, Subtraction. BODMAS and BIDMAS are common in India and the UK, and BEDMAS in Canada.

**Does multiplication come before division?**

No. Multiplication and division have equal priority. You do whichever appears first when reading from left to right. The order of the letters in BODMAS or PEMDAS is just to make a word you can say.

**Does addition come before subtraction?**

No. They also have equal priority and are worked from left to right. So 10 - 3 + 2 equals 9. Doing the addition first would give 5, which is a very common mistake.

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

Under the standard left to right rule it is 9, which is what most calculators and programming languages give. Some people read 2(1 + 2) as a single term and get 1. The expression is ambiguous as written, which is why careful writers add brackets.

**What does the O in BODMAS mean?**

Usually Orders, meaning powers such as squares and cubes, and roots such as square roots. Some teachers explain it as Of, as in half of 10, which is a multiplication. BIDMAS uses I for Indices, which means the same as Orders.

**Why do we need an order of operations?**

So that a written calculation has exactly one meaning. Without an agreed rule, 3 + 4 x 2 could be 14 or 11 depending on the reader. Scientists, engineers, calculators and programming languages all rely on the same convention.

---

*Source: https://learn.modernagecoders.com/blog/bodmas-rule-explained/*
