Math & Basic

Scientific Calculator

Trigonometry, logarithms and advanced operations.

0
What is the Scientific Calculator?

Beyond standard arithmetic, this tool computes trigonometric, logarithmic, root, power, factorial, and parenthesized expressions common in engineering and science. It parses expressions directly in the browser (no server, no external library, no eval) and correctly applies operator precedence even with nested parentheses.

Supported functions

sin, cos, tan are trigonometric functions; toggle DEG/RAD at the top to switch between degrees and radians. log is base-10 logarithm, ln is natural logarithm (base e). √ computes square root, x² squares, and x^y raises to any power (right-associative, highest precedence). n! (factorial) is defined only for non-negative integers, and π/e insert the respective constants instantly.

How to use it

Tap numbers, functions, and operators, then press = to compute. C clears everything, ← deletes the last character, ± flips the sign, and % converts to a percentage. Keyboard shortcuts: digits and + - * / ^ ( ), . for the decimal point, Enter to compute, Backspace/Esc to delete, and ! for factorial.

Sample inputs and results
InputModeResult
sin(30)DEG0.5
log(100)-2
√(16)-4
2^10-1024
5!-120
DEG/RAD pitfalls and floating-point limits — verified by hand

Mixing up DEG and RAD mode is one of the most common scientific-calculator mistakes. In DEG mode, sin(30) converts 30° to radians (30×π/180≈0.5236) first, giving 0.5. In RAD mode, the same sin(30) treats 30 as radians directly, giving a completely different result of about −0.988. Entering a degree value while the mode is set to RAD can flip the sign entirely, so always check the DEG/RAD indicator before computing.

Floating-point limits are another well-known pitfall: computers can't represent decimals like 0.1 or 0.2 exactly in binary, so 0.1 + 0.2 theoretically yields 0.30000000000000004 rather than 0.3. This calculator rounds every result to at most 10 significant digits (roundSig), so entering 0.1+0.2 here shows a clean 0.3.

Results are always shown in plain decimal notation and never switch to scientific (exponential) notation. For example, 2^100 displays as the full digit string 1,267,650,600,228,229,400,000,000,000,000 rather than 1.27e+30, so very large or small results can appear as long strings of digits.

What's the difference between DEG and RAD?
DEG computes trigonometric functions in degrees, while RAD uses radians. For example, sin(30) is 0.5 in DEG mode, but in RAD mode sin(30) treats 30 as radians and gives a completely different value. Toggle the DEG/RAD button at the top anytime.
What's the difference between log and ln?
log is base-10 logarithm (log₁₀x), while ln is natural logarithm with base e (logₑx). Neither function is defined for values at or below 0, and such inputs are shown as an error.
What values can factorial (n!) be computed for?
Factorial is only defined for non-negative integers. Negative numbers or decimals are undefined and shown as an error. For example, 5! = 5×4×3×2×1 = 120.
Why is sin(30) so different in DEG vs RAD mode?
DEG mode treats 30 as degrees and converts it to radians before computing, giving 0.5. RAD mode uses 30 as radians directly, giving about −0.988. Entering a degree value while in RAD mode can even flip the sign, so always check the mode indicator.
Does 0.1+0.2 give exactly 0.3?
On screen, yes. Floating-point arithmetic theoretically produces a tiny error like 0.30000000000000004, but this calculator rounds every result to at most 10 significant digits, so a clean 0.3 is displayed.