Skip to content
Kalio
Math & Dates

Scientific calculator

A full scientific calculator with trigonometry, logarithms, powers, roots and factorials - type expressions directly or use the keypad.

0

Ready · runs on your device

Nothing is uploaded. This tool runs entirely inside your browser tab. Your files and figures stay on your device - we never receive them, so we cannot read, store or lose them.

Order of operations

The parser follows standard precedence, from tightest to loosest:

  1. Brackets ( )
  2. Functions - sin, ln, sqrt and the rest
  3. Factorial !
  4. Exponentiation ^, right-associative
  5. Unary minus
  6. Multiplication, division, modulo × ÷ %
  7. Addition and subtraction + −

Right-associativity of ^ means 2^3^2 evaluates as 2^(3^2) = 512, not (2^3)^2 = 64. This is the mathematical convention.

Supported functions

CategoryFunctions
Trigonometricsin cos tan asin acos atan
Hyperbolicsinh cosh tanh
Logarithmicln (base e), log (base 10), log2
Roots and powerssqrt cbrt exp ^
Roundinground floor ceil abs sign
Constantspi e tau

Factorial is written postfix: 5! gives 120. It is defined for non-negative integers only, and overflows the double-precision range above 170.

Worked examples

Compound growth. 1000 * 1.07^10 → 1,967.15

Hypotenuse. sqrt(3^2 + 4^2) → 5

Half-life. 100 * 0.5^(30/12) → 17.68 (100 units after 30 months, 12-month half-life)

Angle from a slope. In DEG mode, atan(1/2) → 26.565°

Combinations. 10! / (3! * 7!) → 120

Decibels. 20 * log(5) → 13.98

Implicit multiplication

A number followed directly by a bracket, a constant or a function is treated as multiplication: 2(3+1) is 8, 3pi is 9.4248, 2sqrt(9) is 6. This is how people write maths by hand, and supporting it removes a common source of transcription errors.

Why it does not use eval

Most in-browser calculators pass your input to JavaScript’s eval or new Function. That works, but it means anything typed into the box is executed as code.

This calculator instead tokenises the input and evaluates it with the shunting-yard algorithm. The consequence is that only arithmetic is ever possible - there is no code path from the input box to the JavaScript engine. It also means errors can be specific: an unbalanced bracket says so, rather than producing a syntax error or a silent NaN.

Degrees and radians

The DEG/RAD switch converts on the way in for sin, cos and tan, and on the way out for asin, acos and atan. Hyperbolic functions are unaffected, since their argument is not an angle. Getting caught in the wrong mode is the most common cause of a trigonometric answer that looks nonsensical - check the switch before checking your working.

Common questions

Why does −3² give −9 instead of 9?

Because exponentiation binds more tightly than the minus sign, so −3² reads as −(3²). This matches standard mathematical notation and how Python and most textbooks behave. Spreadsheets like Excel do the opposite and return 9. If you want the square of negative three, write (−3)².

Do the trig functions use degrees or radians?

Whichever you select with the DEG/RAD switch - the default is degrees, since that is what most people arrive wanting. The switch affects both directions, so in DEG mode asin(0.5) returns 30 rather than 0.5236.

Can I type an expression instead of pressing keys?

Yes, and it is usually faster. Type something like 2^10 + sqrt(144) and press Enter. Implicit multiplication works too, so 2(3+1) and 2pi are both understood.

Is my input sent anywhere?

No. The expression is parsed and evaluated by a parser running in this page. Notably it does not use JavaScript's eval, which means what you type is never executed as code - it is read as arithmetic and nothing else.

Last reviewed