Expression Calculator
Evaluate arithmetic expressions with decimals, parentheses and integer powers. Follow the order of operations and check each intermediate result.
Interactive workspace
The workspace uses JavaScript. Read the instructions, method, and worked results while it becomes available.
Read the worked examplesHow to use Expression Calculator
- Type the expression as it appears on the page or load a worked example. Use a decimal point for fractions and an explicit multiplication sign between factors.
- Select Calculate. Read the result and the evaluation steps. Each row shows the operands available at that stage and the value passed to the next operation.
- Change a sign or move a pair of parentheses and calculate again. Find the first step that changes, then compare that step with the grouping in your original formula.
What is Expression Calculator?
An arithmetic expression combines numbers and operators into one value. Writing it on a single line removes some of the layout cues you get on paper, especially fraction bars and raised exponents. This calculator makes the grouping visible by listing the operations in evaluation order. You can also enter a single signed number to check how a value written in scientific notation will display.
- Evaluate decimal and scientific notation locally in your browser
- Inspect individual arithmetic operations, signed quantities and whole-number powers
- Copy a result displayed to 12 significant digits and inspect the longer working value
Read a difference from left to right
For 181.5 − 380.25, first estimate the sign. Starting near 180 and taking away an amount near 380 should put the result near negative 200. To do the arithmetic on paper, align the decimal points and write the first number as 181.50. The larger magnitude exceeds the smaller by 198.75, so the signed result of the original subtraction is −198.75.
You can check the answer with a different operation. Add 380.25 back to −198.75 and you return to 181.50. Exchanging the two original inputs would preserve the size of the gap but reverse its direction. That detail matters when the inputs are readings taken at different times. For a change over time, write down which reading is the starting value before typing the subtraction.
Keep the cube with its denominator
In −128/(1.68)^3 the numerator is negative and the denominator is positive. Cube the denominator by multiplying 1.68 by itself twice. The square is 2.8224 and multiplying by 1.68 once more gives 4.741632. Dividing −128 by that value gives about −26.9949249541. As a quick scale check, 27 times the denominator is 128.024064, so the result should lie just above −27.
An exact fraction gives a second check without reusing that decimal division. Write 1.68 as 42/25. Dividing by its cube is equivalent to multiplying by (25/42)^3. Multiplying by −128 and reducing gives −250000/9261. Enter either form to check the displayed result. Moving the cube outside parentheses around the entire quotient would also cube the numerator, which would answer a different question.
Translate a formula written on paper
A horizontal fraction bar groups everything above it into the numerator and everything below it into the denominator. When copying a fraction onto one line, put parentheses around each group that contains a sum or difference. For example, a numerator of 12 + 8 over a denominator of 5 − 1 becomes (12 + 8)/(5 − 1), giving 5. Entering 12 + 8/5 − 1 instead gives 12.6.
Products and divisions share a level and are performed from left to right. Thus 24/3*2 gives 16. If you mean to divide by the product of 3 and 2, enter 24/(3*2) and you get 4. Sums and differences likewise share a level. Write a multiplication sign between adjacent factors. An expression such as 2(3 + 4) needs to be entered as 2*(3 + 4) here.
Give a minus sign a clear scope
A leading sign can apply to a whole powered quantity. The input −2^2 squares 2 and then negates 4. To square negative two, enter (−2)^2. The two negative factors multiply to positive 4. Trying the same pair with an odd power can hide a grouping mistake because both forms give the same negative answer. Use an even power to check the convention in another calculator.
A minus sign in the exponent takes a reciprocal. For 2^−3 the base remains positive and the result is 1/8, or 0.125. Consecutive powers group from the right. In 2^3^2 the exponent is 3^2, or 9, and 2^9 gives 512. If the intended base is the completed power 2^3, put it in parentheses. The expression (2^3)^2 gives 64.
Read a rounded result without losing the next step
The calculator reads numbers as decimals and rounds arithmetic operations to 40 significant digits. The result panel shows up to 12 significant digits and the steps show the working values. For a repeating quotient, even the longer value is a finite approximation. Copying the short result and entering it in a fresh calculation can discard digits that the original expression still had available.
Consider splitting a length into seven equal pieces, then multiplying one piece by three. Keep the problem together as (1/7)*3. If you replace 1/7 with 0.14 before multiplying, you get 0.42. Keeping the division in place gives 0.428571428571 on the display. Choose the reporting precision after the calculation, based on how finely the original length was measured.
Check a percentage formula before reusing it
Suppose a test run took 80 seconds and a second run took 68 seconds. To describe the change relative to the first run, group the difference before dividing by the starting time. Enter (68 − 80)/80*100. The difference is −12 seconds and dividing by 80 gives −0.15. Scaling by 100 expresses the result as a percentage, a 15 percent decrease. A percentage comparison needs the same units for both times.
A missing pair of parentheses can still produce a reasonable-looking number in another example. To find the mistake, write down the unit you expect after each step. Subtracting two times gives a time. Dividing that difference by a time gives a unitless ratio. If the first operation in the trace divides one reading by the other before the difference has been formed, revisit the grouping in your original expression.
Worked examples you can try
Each example uses illustrative inputs. Load its named preset in the calculator above, then calculate to compare with the expected result.
Subtract a larger decimal
Find the signed difference and check it by addition.
181.5-380.25
-198.75
Divide by a cubed decimal
Apply the cube to the denominator before dividing.
-128/(1.68)^3
-26.9949249541
Group a chain of powers
Compare right-to-left powers with a parenthesized base.
2^3^2
512
Learn a little more
How to undo repeated scaling with negative exponentsRecover an original price from a receipt with stacked discountsFrequently asked questions
Can I enter numbers in scientific notation?
Yes. Enter 1.68e2 for 168 or 1.68e-2 for 0.0168. A signed exponent following e shifts the decimal point by powers of ten. The caret raises an entire base to an integer power. Each number can contain up to 40 mantissa digits, including any leading or trailing zeros.
What happens when a denominator evaluates to zero?
The calculator stops at that division. In 12/(4 − 4), both original inputs in the denominator are valid numbers, but their difference is zero. Work through the denominator as a separate expression to find the operation that produced it.
Which powers and expressions are supported?
Use integer powers from −1000 through 1000. Zero can be raised to a positive power. The calculator reports an error for zero to the power of zero, roots written as fractional powers, variable names and functions. Individual expressions can contain up to 256 characters. Nonzero working values must have a base-ten exponent between −1000 and 1000.