Order of Operations Calculator (PEMDAS / BODMAS)

Type an expression with + − × ÷, powers and brackets and see it worked out one step per line in PEMDAS / BODMAS order, with exact fractions.

Numbers, + − × ÷ (or * and /, or x for times), ^ for powers, and brackets ( ) [ ] { }. A number right before a bracket means multiply: 4(5 − 2).

Results

Answer
15
Working, one step per line
18 ÷ 6 + 4(5 − 2) = 18 ÷ 6 + 4 × 3 (inside brackets, subtract: 5 − 2 = 3) = 3 + 4 × 3 (divide: 18 ÷ 6 = 3) = 3 + 12 (multiply: 4 × 3 = 12) = 15 (add: 3 + 12 = 15)
How the expression was read
18 ÷ 6 + 4(5 − 2)
Number of steps
4

How it’s calculated

The order of operations is the agreed order for working out an expression, so everyone gets the same answer. It is remembered as PEMDAS (Parentheses, Exponents, Multiplication and Division, Addition and Subtraction) or BODMAS / BIDMAS (Brackets, Orders or Indices, Division and Multiplication, Addition and Subtraction). Both mean the same:

Brackets → Exponents → × and ÷ (left to right) → + and − (left to right)

Example: 18 ÷ 6 + 4(5 − 2). Brackets first: 5 − 2 = 3, giving 18 ÷ 6 + 4 × 3. Then divide and multiply from the left: 18 ÷ 6 = 3, then 4 × 3 = 12, giving 3 + 12. Finally add: 15.

Conventions used here. A minus sign in front of a power is applied after the power, so −3^2 = −(3^2) = −9; write (−3)^2 to get 9. This matches the textbook rule that −2⁴ is the opposite of 2⁴. A stack of powers is worked from the top down (right to left): 2^3^2 = 2^9 = 512. A number written next to a bracket, as in 4(5 − 2), means multiply, and it is treated like any other × (left to right with ÷), as in OpenStax Example 2.10, so 6 ÷ 2(1 + 2) = 3 × 3 = 9. Some people and some calculators give a bracket written straight after a number priority and get 1, so write 6 ÷ (2(1 + 2)) if you mean 1. Superscript powers are read as one exponent: 2²³ = 2^23. Answers are exact: a result that is not a whole number or an ending decimal is shown as a fraction, such as 1/3.

Frequently asked questions

Is PEMDAS the same as BODMAS?

Yes. Parentheses and brackets are the same thing, and exponents, orders and indices are all powers. In both, multiplication and division have equal rank and are done left to right, as are addition and subtraction.

Does multiplication always come before division?

No. They have the same rank, so you do whichever comes first reading from left to right. 12 ÷ 3 × 2 = 4 × 2 = 8, not 12 ÷ 6 = 2.

Why is −3^2 equal to −9?

The exponent applies only to the 3, and the minus sign is applied afterwards: −3^2 = −(3 × 3) = −9. To square negative three, write (−3)^2 = 9.

Can I type x for times?

Yes. x, *, × and · all mean multiply, and / or ÷ mean divide. Letters other than x are not allowed because this tool works with numbers only.

Embed this calculator

Add this free calculator to your own website. Copy the code below into your page’s HTML:

Need this calculator branded, changed or built around your own prices?See custom business solutions →

Sources

Formulas are taken from the free public references above. Results are provided “as is” for informational and educational purposes only. See our disclaimer.

Added · Last updated · How we check our calculators

Spotted a mistake or missing option? Report a problem· Suggest a calculator