Sizely
Math Equation Solver

Math Equation Solver

Math equation solver: work out math expressions with brackets, exponents and roots in the right order of operations. Learn to solve for x by hand too.

Sophie Clipton

Written by

Sophie Clipton

Updated

There was an error with your calculation.

Answer

-490

Math equation solver at a glance#

What does the math equation solver do?#

The solver evaluates the value of a mathematical expression that is composed of numbers, following the order of operations. You can use symbols like + and − for addition and subtraction, * for multiplication, / for division, ^ for exponents, root() for square and other roots, and parentheses, square brackets, or curly braces for grouping. It outputs a single number. It doesn't solve for variables such as x, but it's useful for verifying solutions you've calculated manually, as we'll show below.

What is the order of operations?#

The order of operations dictates the sequence to solve an expression: first parentheses and other brackets, then exponents, followed by multiplication and division from left to right, and finally, addition and subtraction from left to right. Many remember this sequence as PEMDAS. Without this fixed order, 12 + 7 × 2 might come out as 38 or 26. With the order of operations, the solution is always 26.

What is −10 + ((−7) × 8) − (−9)²?#

The correct answer is −147. Start by solving the brackets and the exponent: (−7) × 8 = −56 and (−9)² = 81. Then proceed from left to right: −10 + (−56) − 81 = −147. To verify this here, input -10+((-7)*8)-(-9)^2.

The order of operations, step by step#

OpenStax Prealgebra 2e outlines the order of operations across four steps:

  • You begin with parentheses and other grouping symbols, starting with the innermost pair and working outward.
  • Next, you handle exponents, which also includes roots.
  • Following that, multiplication and division are performed in sequence from left to right, as they share the same level of priority.
  • Finally, addition and subtraction are done, also in order from left to right, since they too hold equal priority.
The order of operations as four ranks: 1 brackets, innermost first, 2 exponents and roots, 3 multiply and divide from left to right, 4 add and subtract from left to right, with the example 12 + 7 × 2 = 12 + 14 = 26
Work from the top rank down, and left to right within a rank.

The mnemonic Please Excuse My Dear Aunt Sally is a helpful way to remember this sequence: parentheses, exponents, multiplication, division, addition, and subtraction. A frequent misunderstanding is assuming multiplication always precedes division, or addition precedes subtraction. This isn't the case. Each pair holds the same rank, so you address whichever appears first as you read from left to right. This is why 12 / 3 * 2 evaluates to 8, rather than 2.

A worked example: the calculator's default expression#

The calculator starts with (10+5^2)((5*-2)+9-3^3)/2. Here's how it reaches −490.

  1. Within the first brackets, the exponent is handled first, so you compute 5² = 25, followed by 10 + 25 = 35.
  2. In the second set of brackets, you multiply and address the exponent initially: calculate 5 × −2 = −10 and 3³ = 27. Then, proceed left to right: −10 + 9 − 27 = −28.
  3. When two brackets appear side by side, they multiply, which gives 35 × (−28) = −980.
  4. Finally, you conclude with division: −980 ÷ 2 = −490.
(10 + 5²)((5 × −2) + 9 − 3³) ÷ 2 worked step by step: 5² = 25, 5 × −2 = −10 and 3³ = 27, the brackets become 35 and −28, 35 × (−28) = −980, and −980 ÷ 2 = −490
The calculator's default expression, one rule at a time.

How to type an expression#

The calculator understands plain keyboard symbols:

  • Use * to multiply and / to divide. You can't use the symbols × and ÷, and the letter x won't work as a times sign, so type 4.16*0.2, not 4.16x0.2.
  • Use ^ to indicate a power: 5^3 is 125.
  • For a square root, type root(number), and for an nth root, type root(number, n): root(16) is 4, root(27,3) is 3, and root(-8,3) is −2.
  • You can group expressions using parentheses, square brackets, or curly braces interchangeably: [2+3]*{4-1} is 15.
  • When a number appears directly before a bracket, it multiplies the bracketed expression: 2(3+4) is 14.
  • To type a negative number, place a minus sign in front: 5*-2 is −10.

The answer is returned as a single number. A decimal answer shows up to 14 significant digits, so a result like 1/3 shows as 0.33333333333333. You should round it to the precision you need.

Traps that change the answer#

Some expressions can give unexpected results due to how the rules are applied.

  • A minus sign in front of a power. -3^2 is −9, since the exponent is applied before the minus sign. To square −3, use brackets: (-3)^2 is 9.
  • Stacked exponents. 2^3^2 is 512 because stacked powers are processed from right to left: 3² = 9 first, then 29 = 512.
  • A number before a bracket after a division. Here, 8/2(2+2) comes out as 16, because the calculator divides 8 by 2 and then multiplies by (2 + 2). Some might read 2(2 + 2) as a single unit and get 1. If that's your intention, use brackets: 8/(2(2+2)) is 1. The math.js syntax guide, which explains the parser this calculator uses, covers this rule.
  • Division by zero. 10/0 shows Infinity, and 0/0 shows an error. Neither one is a real number.

Solving an equation for x by hand#

The calculator evaluates expressions, but it can't solve for x in an equation like 7c + 12 = −4c + 78. You'll need to manipulate the equation, performing the same operation on both sides until the variable stands alone. OpenStax Elementary Algebra 2e follows a similar approach: first get the variable terms on one side and the numbers on the other, then divide.

  1. Add 4c to each side, which gives 11c + 12 = 78.
  2. Subtract 12 from both sides, giving you 11c = 66.
  3. Divide each side by 11, leaving c = 6.

You can check your work using the calculator. Input 7*6+12 for the equation's left side and -4*6+78 for the right side, and both should equal 54. This confirms that c = 6 is correct.

Inequalities are similar but have an extra rule: if you multiply or divide both sides by a negative number, you'll need to flip the inequality sign. Consider −4x + 87 > 115. Subtract 87 to get −4x > 28. Divide by −4 and flip the sign to find that x is less than −7. Verify by using a value less than −7, such as x = −8. Typing -4*(-8)+87 gives 119, which is greater than 115.

For equations with x², such as 2x² − 4x − 6 = 0, use the quadratic formula calculator to find both roots.

Order of operations examples#

The following table illustrates expressions as they would be typed, the results returned by the calculator, and the rules that govern these outcomes.

Order of operations examples
Type ThisResultWhy
12+7*226multiplication before addition
(2^3)*(3+5)64brackets and the exponent first
20–6/217division before subtraction
12/3*28multiply and divide from left to right
-3^2−9the exponent comes before the minus sign
(-3)^29the brackets square −3
2^3^2512stacked exponents run right to left
8/2(2+2)168 ÷ 2 first, then × (2 + 2)
-10^2-(-6)*2^3+7−45−100 + 48 + 7
-10+((-7)*8)-(-9)^2−147−10 − 56 − 81
root(-8,3)−2the cube root of a negative number

Sources#

Frequently asked questions#

Can the math equation solver solve for x?#

No, it evaluates expressions made of numbers. An expression with an unknown such as x returns an error, and an equation with an equals sign doesn't get solved. You need to solve the equation by hand, then substitute your answer into each side to verify that both sides match.

Why does a decimal answer show at most 14 significant digits?#

Computers store most decimals in binary, which can't hold numbers like 0.2 exactly. That leaves a tiny error in the last digits, so 4.16*0.2 works out to 0.8320000000000001 inside the computer. Showing at most 14 significant digits drops that error, so the solver displays the exact answer, 0.832. To round to fewer decimal places, use the rounding calculator.

How do I enter a square root or cube root?#

To find the square root of 16, type root(16), which is 4. For other roots, add a second number: root(27,3) gives you the cube root of 27, which is 3. The cube root calculator can also handle cube roots independently.

Is multiplication done before division?#

No, multiplication and division have the same rank, so you perform them from left to right. 12 / 3 * 2 is 4 * 2 = 8. This rule also applies to addition and subtraction: 10 − 4 + 3 is 9, not 3.

Do square brackets and curly braces work?#

Yes, the calculator treats [ ] and { } the same as ( ), so [2+3]*{4-1} is 15. Using different bracket shapes can help make nested groups easier to read.