Scientific Calculator
Trigonometry, logarithms and advanced operations.
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.
| Input | Mode | Result |
|---|---|---|
| sin(30) | DEG | 0.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.