Scientific Calculator
A full scientific calculator with trigonometric, logarithmic, exponential, and expression evaluation, honoring standard order of operations
By Waqar Mushtaq · Last updated:
This scientific calculator evaluates a full expression at once — parentheses, exponents, trigonometric and logarithmic functions, and factorials — honoring standard order of operations (PEMDAS), unlike a basic four-function calculator that applies each key press immediately, left to right. Type or tap out an expression such as sin(30) + sqrt(16) / 2 and it's evaluated the way a written formula or graphing calculator would evaluate it, not the way pressing physical calculator keys in sequence would.
Order of Operations and Function Evaluation
O(n) in expression lengthMultiplication is evaluated before addition (PEMDAS), unlike a basic calculator's left-to-right evaluation
Trig functions require knowing which angle unit θ is expressed in
Expressions are evaluated with standard mathematical precedence: parentheses first, then exponents (^) and functions, then multiplication/division, then addition/subtraction. Exponentiation is right-associative, so 2^3^2 evaluates as 2^(3^2) = 2^9 = 512, not (2^3)^2 = 64.
Degrees vs. radians: Trigonometric functions need an angle unit, not just a number — sin(30) means something completely different depending on whether 30 is degrees or radians. Under the hood, JavaScript's Math.sin() and related functions always expect radians, so this calculator converts your input based on the DEG/RAD toggle before calling them, and converts inverse-trig results back. This calculator also shows both interpretations side by side whenever your expression contains a trig function, since mixing up degrees and radians is one of the most common real mistakes when using any scientific calculator.
Factorial (x!) is only defined for non-negative integers, computed as n! = n × (n-1) × ... × 1, with 0! = 1 by convention.
Logarithms: log(x) is base-10, ln(x) is the natural logarithm (base e ≈ 2.71828). Both are undefined for zero or negative inputs.
Use Cases
Homework and Coursework
Evaluate multi-step expressions with correct order of operations, check trigonometric identities, or verify logarithm and exponent calculations for algebra, trigonometry, or precalculus coursework.
Engineering and Physics Calculations
Quickly evaluate formulas involving trig functions, square roots, and exponents — for example computing a vector component with sin/cos, or a decay formula with exp() — without opening a full computer algebra system.
Checking Degree vs. Radian Results
The side-by-side degree/radian comparison catches the single most common trig mistake: forgetting which angle unit a formula (or a homework problem) expects.
Quick Log and Exponential Math
Compute pH-style logarithmic scales, compound growth exponents, or decibel/Richter-scale-style calculations that rely on log or ln, without doing the arithmetic by hand.
Frequently Asked Questions
How is this different from the Basic Calculator on this site?
The Basic Calculator applies each operator immediately as you press it, left to right, the way a simple four-function calculator works — 2 + 3 × 4 gives 20. This Scientific Calculator evaluates the full expression at once using standard order of operations (PEMDAS), so the same input gives 14. It also adds trigonometric, logarithmic, exponential, and factorial functions that a basic calculator doesn't have.
Should I use DEG or RAD mode?
Use DEG (degrees) if your angle is expressed as a value between 0 and 360, which is the everyday convention. Use RAD (radians) if your angle is already expressed as a multiple of π (for example, π/2 for a right angle), which is the standard unit in calculus and most physics/engineering formulas. If you're not sure, the side-by-side comparison shown for any expression with a trig function will show you both.
Why do I get an error for sqrt(-4) or log(0)?
Square roots of negative numbers and logarithms of zero or negative numbers are undefined over the real numbers (they require complex numbers, which this calculator doesn't compute). The calculator returns an error rather than NaN or a nonsensical value in these cases.
What is the largest factorial this calculator can compute?
170! is the largest factorial that fits in a standard double-precision floating-point number without overflowing to Infinity — 171! and above will show an error rather than an inaccurate value.
Does this calculator support nested parentheses and functions?
Yes — expressions like sin(sqrt(2) * pi / 4) or ((2+3)*4)^2 are fully supported, with parentheses nesting to any depth.
Methodology
The formula above is implemented as a standalone module covered by unit tests, so its worked examples are re-checked on every change to the site. It is verified against the authoritative sources listed below.
Maintained by Waqar Mushtaq. Spotted a result that looks wrong? Report it and it becomes a failing test.