Skip to content
Utilboxes

Scientific Calculator

Type an expression such as 2 * (3 + 4)^2, or use the keypad, and press Enter. The calculator handles trigonometry in degrees or radians, logarithms, powers, roots, factorials, π and e, and memory, with correct operator precedence. Every result goes into a history you can click to reuse, and errors are explained precisely.

Runs entirely in your browser

Updated

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.

Tips and common mistakes

  • Check the angle mode before using sin, cos or tan; degrees and radians give completely different answers.
  • Use parentheses whenever you are unsure of the order; extra brackets never change a correct result.
  • Click a line in the history to reuse it instead of retyping.
  • Use the memory keys to keep a running total across several calculations.

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.
Why does sin(30) give −0.988 instead of 0.5?
The calculator is in radians. Switch to degrees and sin(30) gives 0.5.
Why does log of a negative number give an error?
The logarithm of a negative number, or of zero, is not defined in real numbers, so the calculator reports it rather than showing a meaningless result.
Can I reuse an earlier answer?
Yes. Click any line in the history to bring that expression back into the input.

Guides