๐Ÿงฎ Scientific Calculator

1

Type expressions directly using functions like sin, cos, tan, log, ln, and square root, plus constants like ฯ€ (pi) and e (Euler's number). You can type the expression directly or build it up using the buttons below.

How to use

  1. Type an expression directly into the input field, or click the buttons below to build one.
  2. The result updates in real time as you type.
  3. Use "C" to clear everything, or "โŒซ" to delete one character.

How the calculation works

This scientific calculator parses and evaluates the expression you type, using this order of operations: 1. Parentheses 2. Powers ^ (right to left: 2^3^2 = 2^9 = 512) 3. Unary minus (-2^2 = โˆ’(2^2) = โˆ’4) 4. Multiplication * and division / (left to right) 5. Addition + and subtraction โˆ’ (left to right) Functions: sin, cos, tan, asin, acos, atan, sqrt, log (base 10), ln (natural), exp, abs Constants: pi, e The expression is split into numbers, names and symbols (tokenising) and evaluated by a recursive-descent parser that follows the precedence rules. For safety it never uses JavaScript's eval, which could run arbitrary code.

Worked example

sin(pi/2) = 1 2^3^2 = 512 -2^2 = โˆ’4 log(1000) = 3 ln(e) = 1 sqrt(2) โ‰ˆ 1.4142135624 Sine of 30 degrees: sin(30*pi/180) = 0.5 (sin(30) treats 30 as radians and gives about โˆ’0.988)

Things to be aware of

  • Trigonometric functions use radians. For degrees, enter "degrees ร— pi รท 180".
  • Implicit multiplication such as 2(3) is not supported; write 2*(3).
  • Division by zero and results that are not real numbers, such as sqrt(-1), are reported as errors.

FAQ

Are angles in radians or degrees?

Trigonometric functions (sin, cos, tan, etc.) use radians. To use degrees, enter it as degrees ร— pi รท 180.

What's the difference between log(...) and ln(...)?

log(...) calculates the base-10 (common) logarithm, while ln(...) calculates the natural logarithm with base e.

What if my expression isn't calculating correctly?

Check that your parentheses are balanced and function names are spelled correctly. An error message appears in the result area for invalid expressions.