Scientific Calculator
A full scientific calculator with trig functions, logarithms, exponents, factorials, and constants. Supports degree and radian mode, parentheses, expression history, and keyboard input.
Keyboard supported · Enter = calculate · Esc = clear · Backspace = delete
Result
Enter an expression above
History
- No calculations yet
Learn more
How it works
The formula, explained simply
This calculator evaluates full mathematical expressions rather than operating step-by-step. Type an expression like sin(30) + log(100) and press = to get the result. It handles operator precedence, parentheses, and nested functions correctly.
Trigonometric functions (sin, cos, tan) operate in whichever angle mode is selected — DEG or RAD. In degree mode, sin(90) = 1. In radian mode, sin(π/2) = 1. Switch modes using the toggle above the buttons.
The calculator uses math.js, a well-tested open-source library, for all expression evaluation. This avoids the security risks of JavaScript's eval() while handling complex expressions accurately.
Press sin, cos, or tan — the calculator opens a parenthesis automatically. Enter your angle, close the parenthesis, and press =. Make sure your angle mode (DEG or RAD) matches your input. Example: sin(30) in DEG mode gives 0.5.
log calculates the base-10 logarithm. ln calculates the natural logarithm (base e ≈ 2.718). log(100) = 2 because 10² = 100. ln(e) = 1 because e¹ = e. Use ln for natural growth and decay problems; log for pH, decibels, and Richter scale.
Yes. Type numbers and operators directly. Press Enter or = to calculate. Backspace deletes the last character. Escape clears everything. The * key maps to multiplication and / maps to division.
The maths
Key functions and how they're calculated
Trigonometric functions are based on the unit circle. sin(θ) gives the y-coordinate, cos(θ) gives the x-coordinate, and tan(θ) = sin(θ)/cos(θ). They're periodic: sin and cos repeat every 360° (2π radians); tan repeats every 180° (π radians).
Logarithms answer the question "what power do I raise the base to, to get this number?" log(1000) = 3 because 10³ = 1000. Logarithm properties: log(ab) = log(a) + log(b), and log(aⁿ) = n·log(a).
Exponentials represent repeated multiplication. The ^ operator raises a base to a power: 2^10 = 1024. Fractional exponents represent roots: 8^(1/3) = ∛8 = 2.
Factorials (n!) multiply every integer from 1 to n. 5! = 5×4×3×2×1 = 120. They appear throughout probability and combinatorics — the number of ways to arrange n items is n!.
Common mistakes
Where calculations go wrong
Wrong angle mode. This is the most common trig error. sin(30) in degree mode = 0.5. sin(30) in radian mode ≈ −0.988. Always check the DEG/RAD toggle before computing trig functions.
Logarithm domain. log and ln are only defined for positive numbers. log(0) and log(−5) produce errors. If you see "Error", check that your input is positive.
Order of operations. 2+3×4 = 14, not 20 — multiplication happens before addition. Use parentheses to force a different order: (2+3)×4 = 20.
tan(90°). Mathematically undefined (division by zero). The calculator returns a very large number or Infinity, not an exact answer.
When to use this
Real-world applications
Physics and engineering. Trig functions appear in forces, waves, and circuit analysis. Logarithms appear in decibels (sound), Richter scale (earthquakes), and filter design.
Chemistry. pH = −log[H⁺]. Radioactive decay uses exponentials. Gas law calculations involve powers and roots.
Finance. Compound interest uses exponentials. Present value and IRR calculations involve logarithms.
Statistics. Factorials appear in combinations and permutations. Normal distribution calculations involve e and exponents.