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 first, working from the innermost bracket out.
- Exponents (powers) next.
- Multiply and divide from left to right. Neither one comes first: whichever is further left is done first.
- Add and subtract from left to right, the same way.
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
- Prealgebra 2e, §2.1 Use the Language of Algebra (order of operations, Example 2.10) — OpenStax
- Elementary Algebra 2e, §1.4 Multiply and Divide Integers (−2⁴ is the opposite of 2⁴) — OpenStax
- Prealgebra 2e, §3.4 Multiply and Divide Integers (order of operations with negatives) — OpenStax
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