Order of Operations Calculator
An expression calculator evaluates a whole formula in one go, following the order of operations. For 3 + 4 × (2 − 1)² ÷ 5 the result is 3.8: brackets first, then the power, then multiplication and division, then addition.
Last updated · By S. Dilshan · Runs in your browser, nothing is uploaded
Step-by-Step Solution
What Is an Expression Calculator?
An expression calculator lets you type a complete calculation exactly as you would write it, with brackets, exponents, fractions and functions, and returns the result. It saves you from keying in one step at a time and from the mistakes that come with doing so, and it applies the standard order of operations automatically.
It supports the usual operators (+, −, ×, ÷, ^), brackets, constants such as π and common functions such as square roots, logarithms and trigonometry. You can choose whether sine, cosine and tangent work in radians or degrees.
The Order of Operations (PEMDAS / BODMAS)
| Priority | Operation | Example |
|---|---|---|
| 1 | Brackets (parentheses) | (2 − 1) |
| 2 | Exponents and roots | 2³, √16 |
| 3 | Multiplication and division, left to right | 4 × 3 ÷ 2 |
| 4 | Addition and subtraction, left to right | 3 + 4 − 1 |
Multiplication and division share the same level and are done left to right, and the same applies to addition and subtraction.
How Expressions Are Evaluated
- Use
*for multiplication,/for division and^for powers. - Functions include
sqrt(),abs(),ln(),log()(base 10),sin(),cos()andtan(). piandeare available as constants.- Exponents bind more tightly than a leading minus sign:
-2^2means −(2²) = −4, not (−2)² = 4.
For powers and roots on their own, see the exponent calculator and the square root calculator.
Worked Example: 3 + 4 × (2 − 1)² ÷ 5
- Brackets: (2 − 1) = 1.
- Exponent: 1² = 1.
- Multiplication: 4 × 1 = 4.
- Division: 4 ÷ 5 = 0.8.
- Addition: 3 + 0.8 = 3.8.
The calculator reports 5 operations performed and the result as 3.8, or 3.8 × 10⁰ in scientific notation.
More Examples
| Expression | Result | Why |
|---|---|---|
| (3 + 4) * 2 − 5 / 2 | 11.5 | Brackets: 7; 7 × 2 = 14; 5 ÷ 2 = 2.5; 14 − 2.5 |
| sqrt(16) + 2^3 | 12 | 4 + 8 |
| −2^2 | −4 | The power happens before the minus sign |
| log(1000) + ln(1) + abs(−3) | 6 | 3 + 0 + 3 |
| sin(30) in degrees | 0.5 | Angle unit set to degrees |
| 2 * pi | 6.2832 | The circumference of a unit circle |
The Famous Ambiguous Expression
6 ÷ 2(1 + 2) causes online arguments. Written as 6/2*(1+2), standard left-to-right evaluation gives 6 ÷ 2 = 3, then 3 × 3 = 9. The confusion arises because some people treat the implied multiplication 2(1 + 2) as binding more strongly. Always use explicit brackets to remove doubt.
Nested Brackets
Work from the innermost brackets outward. For ((2+3)*4 − 6)/7: 2 + 3 = 5, then 5 × 4 = 20, then 20 − 6 = 14, and finally 14 ÷ 7 = 2.
Percentages and Compound Growth in an Expression
There is no % key inside an expression, so convert to decimals. 15% of 80 is 0.15*80 = 12. A price of 80 with 8% added is 80*(1+0.08) = 86.4. Compound interest on $1,000 at 5% for 10 years is 1000*(1+0.05)^10 = 1,628.89.
Checking Your Own Working
Type each stage of a long calculation as its own expression and compare with your hand result. If the final answer differs, the step-by-step comparison shows exactly where the slip happened.
How to Use This Expression Calculator
- Type your expression into the box, for example
3 + 4 * (2 - 1)^2 / 5. - Choose radians or degrees if your expression uses sin, cos or tan.
- Read the result, the scientific-notation form, the rounded value and the number of operations.
- If you see an error, check that every bracket is closed and every operator has a number on both sides.
Use explicit multiplication signs: write 2*(3+4), not 2(3+4).
Where Expression Calculators Are Useful
- Homework and revision: checking multi-step arithmetic against the order of operations.
- Engineering and science: evaluating formulas that combine powers, roots and trigonometry.
- Finance and spreadsheets: testing a formula before putting it in a cell.
- Programming: verifying operator precedence before writing code.
- Everyday arithmetic: bills, recipes and conversions with several steps.
What Are the Most Common Mistakes With the Order of Operations Calculator?
- Forgetting brackets. 3 + 4 × 2 = 11, but (3 + 4) × 2 = 14.
- Misreading −2² as 4. It is −4 unless you write (−2)^2.
- Wrong angle unit. sin(30) is 0.5 in degrees but −0.988 in radians.
- Implied multiplication. Always write the * sign to avoid ambiguity.
- Dividing by zero. This is undefined and produces an error.
- Unbalanced brackets. Every opening bracket needs a matching closing bracket.
Where Can You Verify These Formulas?
The definitions and formulas on this page follow standard references. Check them against these sources:
Built and maintained by S. Dilshan. Found a mistake? Email [email protected] with the page address.
Frequently Asked Questions
What is the order of operations?
Brackets first, then exponents, then multiplication and division from left to right, then addition and subtraction from left to right. It is remembered as PEMDAS or BODMAS.
What is 3 + 4 × (2 − 1)² ÷ 5?
3.8. Brackets give 1, the power gives 1, 4 × 1 ÷ 5 = 0.8, and 3 + 0.8 = 3.8.
Why is −2² equal to −4?
Exponents are evaluated before the negative sign is applied, so −2² means −(2²) = −4. To square −2, write (−2)².
What is 6 ÷ 2(1 + 2)?
Evaluated strictly left to right it is 9. The expression is ambiguous as written, so use brackets to show what you mean.
Does the calculator use radians or degrees?
You choose. Select radians or degrees for sin, cos and tan.
Which functions can I use?
sqrt, abs, ln, log (base 10), sin, cos and tan, along with the constants pi and e.