Skip to content
UniKit

Scientific calculator

A scientific calculator with a hand-written expression parser: + - * / % ^ and parentheses, implicit multiplication (2pi, 3(4+5)), factorials, percentages, sin/cos/tan/ln/log/sqrt and friends, π and e constants, degree/radian modes and precise error messages.

Runs in your browserEvery computation happens in your browser — your data never leaves this device.

Expression

The parser is hand-written (lexer plus recursive descent) and everything runs locally in the browser; your expression is never uploaded.

Angle mode
Keypad

Result

Type an expression — the result updates live, no equals key needed.

What this tool does

  • Work out an expression with parentheses, powers and trig functions by typing it straight in — the result updates live, no equals key needed.
  • Check a formula from a textbook or paper: paste something like 2pi + sin(30) - log(1000) instead of chaining the steps by hand and mis-copying an intermediate value.
  • Handle factorials, percentages and modulo without switching tools: 5!, 200*50% and 10%3 all parse directly.
  • Demonstrate operator precedence: compare -2^2 with (-2)^2, or 2^3^2 with (2^3)^2, instead of describing the rules out loud.

Example

Input

2pi + sin(30) - log(1000) (degree mode)

Output

3.78318530718

In degree mode sin(30) = 0.5 and log is base 10, so log(1000) = 3; 2pi uses implicit multiplication.

Frequently asked questions

Why does % sometimes mean modulo and sometimes a percent sign?

One rule decides it: if an operand can still follow (a number, a constant or an opening parenthesis), % is modulo, so 10%3 = 1; otherwise it is a percent sign, so 50% = 0.5 and 200*50% = 100. Both common notations work without extra symbols.

Which functions and constants are available?

sin, cos, tan, asin, acos, atan, sinh, cosh, tanh, ln, log (base 10), log2, sqrt, cbrt, abs, exp, round, floor, ceil, sign, min, max and pow — min/max take any number of arguments. Constants are pi (π works too), tau and e.

How do I switch between degrees and radians?

Use the angle mode buttons above the input. It only affects trigonometric and inverse trigonometric functions: sin(30) = 0.5 and asin(0.5) = 30 in degree mode, sin(pi/2) = 1 in radian mode. Everything else is unaffected.

Is 2e3 equal to 2000 or to 2×e×3?

When e is followed by digits (optionally signed) it is read as scientific notation, so 2e3 = 2000 and 2e-2 = 0.02. Otherwise e is Euler’s number, so 2e means 2×e ≈ 5.4366. Write an explicit multiplication sign if you mean 2×e×3.

Why does ln(-1) report a domain error instead of a complex number?

This calculator is real-valued only, so logarithms of non-positive numbers, square roots of negatives and asin/acos outside [-1, 1] are reported as errors rather than silently returning NaN. Use the complex number calculator when you need complex results.

Keywords:scientific calculatorexpression calculator科学计算器在线计算器sin cos tan三角函数logarithm对数计算factorial阶乘implicit multiplication隐式乘法radian弧度角度

Related tools