Skip to content
PercentPoint

Scientific Calculator

Type a whole expression, with trig functions, logarithms, powers, roots, factorials and combinations, and get the value as you type, in degrees or radians, with the order of operations applied the way algebra textbooks teach it.

For planning only. Your school, syllabus or accountant has the final word. First published · Last reviewed by PercentPoint.

How to use the scientific calculator

  1. Type the expression in the box, or build it with the keys. You can paste a line from homework or a spreadsheet; × ÷ − and square brackets are read the same as * / - and parentheses.
  2. Choose degrees or radians before using sin, cos, tan or their inverses. The setting changes the value of trig functions only.
  3. Read the value under Result. It updates on every keystroke, so you can see where an expression goes wrong as you type it.
  4. Save to history keeps the expression and its value. The latest saved value is available as ans in the next expression.

Unlike a handheld calculator, the whole expression stays visible and editable. If the value looks wrong, you can fix one character instead of starting again, which is the main advantage of typing an expression rather than pressing keys one at a time.

The order of operations it follows

The calculator uses the order taught in the open textbook Prealgebra 2e from OpenStax: parentheses first, then exponents, then multiplication and division from left to right, then addition and subtraction from left to right. The textbook’s own examples give the same results here:

  • 4 + 3·7 = 4 + 21 = 25, while (4 + 3)·7 = 49 (Example 2.8).
  • 18 ÷ 9 · 2 = 2 · 2 = 4, because division and multiplication go left to right (Example 2.9).
  • 18 ÷ 6 + 4(5 − 2) = 3 + 12 = 15 (Example 2.10).
  • 5 + 2^3 + 3[6 − 3(4 − 2)] = 5 + 8 + 3[0] = 13, working from the innermost parentheses outward (Example 2.11). The calculator opens on this one.

Two details decide many disputed answers. Powers are grouped from the right, so 2^3^2 means 2^(3^2) = 2^9 = 512, not 8^2 = 64. And factorial and percent signs attach to the number just before them, before any power is applied.

Negative numbers and powers

A minus sign at the front of a number is applied after the power, as in algebra: −3^2 is −(3^2) = −9. To square negative three, write (−3)^2 = 9. Spreadsheets handle this differently; in Excel, =-3^2 returns 9, so a formula copied from a spreadsheet can give a different answer here. Adding parentheses removes the doubt in both places.

A minus sign after a power is allowed: 2^−3 = 1/8 = 0.125. Powers of negative numbers with fractional exponents, such as (−8)^(1/3), aren’t real numbers in floating-point arithmetic, so the calculator reports an error. Use cbrt(−8) or root(−8, 3), which return −2, for odd roots of negative numbers.

Implied multiplication and 6 ÷ 2(1 + 2)

You can leave out the × sign between a number and a parenthesis, a constant or a function: 2π, 4(5 − 2), (1 + 2)(3 + 4) and 3sin(30) all work. The implied × has the same priority as a written one, so the expression is read left to right with the other multiplications and divisions.

That is why 6 ÷ 2(1 + 2) gives 9 here: 6 ÷ 2 = 3, then 3 × 3. Some calculators and some style guides give implied multiplication a higher priority and return 1. Neither reading is a law of mathematics; the expression is simply ambiguous. Writing 6 ÷ (2(1 + 2)) or (6 ÷ 2)(1 + 2) says what you mean.

Degrees or radians

Trig functions take an angle, and the same number means different angles in the two modes. In degree mode, sin(30) = 0.5. In radian mode, sin(30) is the sine of 30 radians, about −0.988. A wrong mode is the most common reason a trig answer doesn’t match the back of the book.

To convert, use the proportion from OpenStax Algebra and Trigonometry 2e, section 7.1: degrees ÷ 180 = radians ÷ π. Its examples are π/6 radians = 30° and 15° = π/12 radians. In the calculator, 15π/180 gives 0.261799…, which is π/12. One radian is 180/π ≈ 57.2958°.

Inverse functions return an angle in the current mode: asin(0.5) is 30 in degree mode and 0.523599 (π/6) in radian mode. In degree mode, the common angles 0, 30, 90, 180 and so on return exact values, so sin(180) shows 0 rather than a tiny rounding leftover, and tan(90) reports that the tangent is undefined there.

Logarithms and exponentials

log is the common logarithm, base 10, and ln is the natural logarithm, base e. These match the examples in OpenStax Algebra and Trigonometry 2e, section 6.3: log(1000) = 3, because 10³ = 1000; log(321) ≈ 2.5065; and ln(500) ≈ 6.2146.

For any other base, use logb(x, base), which applies the change-of-base rule ln(x) ÷ ln(base). For example, logb(8, 2) = 3, since 2³ = 8. exp(x) is e raised to x, so exp(1) is e ≈ 2.718282 and exp(ln(5)) returns 5. Logs of zero or negative numbers aren’t real, and the calculator says so rather than showing a misleading number.

Factorials, permutations and combinations

n! multiplies the whole numbers from 1 to n, so 5! = 120 and 0! = 1. Factorials work for whole numbers up to 170; 171! is too large for double-precision numbers.

nPr(n, r) counts ordered arrangements of r items taken from n, and nCr(n, r) counts selections where order doesn’t matter. OpenStax Precalculus 2e, section 11.5, shows that choosing 3 officers in order from 6 members gives 6!/3! = 120 ways, and its Example 4 arranges 9 exam questions from a bank of 12: nPr(12, 9) = 79,833,600. Without regard to order, a 5-card poker hand from 52 cards is nCr(52, 5) = 2,598,960.

The calculator computes nPr and nCr directly rather than by dividing huge factorials, so values such as nCr(200, 3) = 1,313,400 stay precise even though 200! itself is out of range.

Precision and how results are shown

The calculator works in double-precision floating point, the number format JavaScript and most spreadsheets use, which carries about 15 to 17 significant digits. Some decimal fractions can’t be stored exactly in binary, so the raw sum of 0.1 and 0.2 is 0.30000000000000004. Showing results to 12 significant digits hides that noise, and the displayed value is 0.3.

Very large and very small results switch to e-notation: 170! is shown as 7.25741561531e+306, meaning 7.257… × 10³⁰⁶. You can type numbers the same way; 2e3 is 2,000 and 6.02e23 is 6.02 × 10²³. A plain e not followed by digits is Euler’s number, so 2e is 2 × 2.71828.

Functions and keys

  • Trig: sin, cos, tan, asin, acos, atan; hyperbolic sinh, cosh, tanh.
  • Logs and powers: log (base 10), ln, logb(x, base), exp, ^.
  • Roots: sqrt or √, cbrt, root(x, n).
  • Counting: ! (factorial), nPr(n, r), nCr(n, r).
  • Other: abs, round, floor, ceil, % (divides by 100, so 200 × 15% = 30), constants π (or pi) and e, and ans for the last saved value.

Function names are read before letters that follow them, so sin30 is sin(30). Parentheses are still clearer: sin 30^2 is the sine of 900, while sin(30)^2 is 0.25.

Sources & assumptions

How this calculator gets its numbers. Full method: our methodology.

  • Order of operations: parentheses; postfix ! and %; powers (right to left, so 2^3^2 = 2^9); a leading minus; × and ÷ left to right; + and − left to right.
  • A minus sign in front applies after the power: −3^2 = −9. Write (−3)^2 for 9.
  • Implied multiplication, as in 2π or 4(5 − 2), has the same priority as ×, so 6 ÷ 2(1 + 2) = 9.
  • % divides by 100 (200 × 15% = 30); it doesn’t add a percentage to the number before it.
  • log is base 10, ln is base e; trig uses the angle mode chosen; results are double-precision and shown to 12 significant digits, with exact values at common degree angles.

Sources

  1. OpenStax, Rice University, Prealgebra 2e, 2.1 Use the Language of Algebra. The order of operations (parentheses, exponents, multiplication and division left to right, addition and subtraction left to right) and Examples 2.8–2.11: 4 + 3 · 7 = 25, 18 ÷ 9 · 2 = 4, 18 ÷ 6 + 4(5 − 2) = 15, and 5 + 2³ + 3[6 − 3(4 − 2)] = 13.
  2. OpenStax, Rice University, Algebra and Trigonometry 2e, 6.3 Logarithmic Functions. Common logarithm (base 10) and natural logarithm (base e), with Examples 5, 6 and 8: log(1000) = 3, log(321) ≈ 2.5065 and ln(500) ≈ 6.2146.
  3. OpenStax, Rice University, Algebra and Trigonometry 2e, 7.1 Angles. Degree–radian conversion, θ/180 = θR/π, with Examples 3 and 4: π/6 radians = 30° and 15° = π/12 radians.
  4. OpenStax, Rice University, Precalculus 2e, 11.5 Counting Principles. Factorials and the permutation and combination formulas, with 6!/3! = 120 and P(12, 9) in Example 4.
  5. Microsoft Support, Calculation operators and precedence in Excel. Excel applies negation (as in –1) before percent and exponentiation, which is why =-3^2 returns 9 in a spreadsheet while algebra, and this calculator, give −9.
  6. MDN Web Docs, Math (JavaScript reference). The browser math functions the calculator calls (Math.sin, Math.log10, Math.pow and others), which take angles in radians and work in double-precision floating point.

Last reviewed . When an expression could be read two ways, add parentheses; the calculator doesn’t guess.

Frequently asked questions

Is this calculator in degrees or radians?

It opens in degrees. Switch the Angles setting to radians when an angle is given in radians, such as π/6. The setting affects sin, cos, tan and their inverses only.

Why does −3^2 equal −9?

The power is applied before the leading minus sign, as in algebra, so −3^2 means −(3 × 3). Write (−3)^2 to square negative three and get 9.

What is 6 ÷ 2(1 + 2)?

This calculator gives 9, treating the implied multiplication like × and working left to right: 6 ÷ 2 = 3, then 3 × 3. Some calculators give 1. Add parentheses to remove the ambiguity.

What is the difference between log and ln?

log is base 10 and ln is base e (about 2.718). log(1000) = 3 because 10³ = 1000, and ln(500) ≈ 6.2146. Use logb(x, base) for other bases.

How do I calculate combinations and permutations?

Use nCr(n, r) when order doesn’t matter and nPr(n, r) when it does. nCr(52, 5) = 2,598,960 five-card hands; nPr(12, 9) = 79,833,600 ordered sets of 9 questions from 12.

Why does 0.1 + 0.2 show 0.3 here but not in some programs?

Computers store 0.1 and 0.2 in binary, so the raw sum is 0.30000000000000004. This calculator shows 12 significant digits, which rounds that to 0.3; programs that print every digit show the leftover.