Skip to content
Utilboxes

Scientific Calculator

A full scientific calculator. Type an expression or use the keypad — trigonometry, logarithms, powers, roots, factorials and memory are all supported.

Runs entirely in your browser

How to use the Scientific Calculator

  1. 1Type an expression such as 2 * (3 + 4)^2 and press Enter, or use the keypad.
  2. 2Switch between degrees and radians for trigonometric functions.
  3. 3Use the memory keys to store and recall a running value.
  4. 4Click any line in the history to bring it back into the input.

How it works

The expression is parsed properly rather than evaluated as code. It is tokenised into numbers, operators and function names, converted to postfix notation with the shunting-yard algorithm — which handles operator precedence and right-associative powers correctly — and then evaluated from that stack.

That matters for safety as much as correctness. Passing user input to eval() would let arbitrary JavaScript run in the page; a dedicated parser can only ever produce a number or a clear error message.

Invalid input is reported precisely: unbalanced parentheses, an unknown function name, a missing operand, or a mathematically undefined result such as the logarithm of a negative number each get their own message rather than a generic failure.

Worked example

Evaluating a compound expression

  1. Type sin(30) with the mode set to degrees → 0.5
  2. Type 2^10 → 1024
  3. Type log(1000) + sqrt(144) → 3 + 12

Result: 15. Each result is added to the history, and can be clicked to reuse.

Frequently asked questions

Does it work in degrees or radians?
Both. A toggle above the keypad switches modes, and the current mode is shown next to the input so trigonometric results are never ambiguous.
Which functions are supported?
sin, cos, tan and their inverses, sinh, cosh, tanh, log (base 10), ln, log2, sqrt, cbrt, abs, exp, floor, ceil, round, factorial via !, plus the constants π and e.
How is precedence handled?
Standard mathematical precedence: parentheses, then powers (right-associative), then multiplication and division, then addition and subtraction. So 2 + 3 × 4 is 14 and 2^3^2 is 512.
Can I use my keyboard?
Yes. Type expressions directly, Enter evaluates, Escape clears, and Backspace deletes. Function names can be typed out in full.