Scientific Calculator
Free online scientific calculator with trig, logs, exponents, square roots, parentheses, and constants pi and e.
Free online scientific calculator with trigonometry, logarithms, exponents, square roots, parentheses, and constants π and e. Switch between degree and radian modes with a single click. Expressions parse with a hand-written recursive-descent parser — there is no eval call, so untrusted input can never reach the JavaScript engine.
Supported syntax at a glance
Operators: + − * / ^ (exponent), % (modulo), and parentheses for grouping. Multiplication is always explicit — write 2*pi, not 2pi.
Functions take exactly one argument in parentheses: sin, cos, tan, asin, acos, atan, ln (natural log), log (base-10), sqrt, abs, exp.
Constants: pi (π ≈ 3.14159…) and e (Euler's number ≈ 2.71828…). Numbers may use scientific notation, e.g. 1.5e3 = 1500.
Order of operations follows PEMDAS / BODMAS: parentheses, exponents, multiplication/division (left to right), addition/subtraction (left to right). Use parentheses generously — they cost nothing and prevent ambiguity.
Degrees vs radians, and why it matters
The angle-mode toggle controls how trig functions interpret their input and output. In degree mode, sin(90) returns 1; in radian mode you would need sin(pi/2) to get the same result. Inverse trig (asin, acos, atan) follows the same convention — output is degrees in degree mode, radians in radian mode.
Calculus, physics, and most programming languages default to radians because the derivative formulas only work cleanly in radians — d/dx sin(x) = cos(x) only if x is measured in radians. Engineering, navigation, and everyday geometry usually use degrees. If a problem gives you angles in degrees and the answer looks suspiciously wrong, the first thing to check is the mode switch.
Worked examples: a few common calculations
Compound interest: 1000 * (1 + 0.05) ^ 10 returns 1628.89 — the value of $1,000 invested for 10 years at 5% annual compounding.
Distance between two points: sqrt((4 − 1)^2 + (8 − 2)^2) returns 6.708, the straight-line distance from (1, 2) to (4, 8).
Solving for an unknown exponent: ln(2) / ln(1.07) returns 10.24 — the rule-of-72 confirmation that money invested at 7% doubles in about 10.24 years.
Trig in surveying: a 30-foot ladder leaning at 75° reaches up the wall 30 * sin(75) ≈ 28.98 feet (in degree mode) and stands 30 * cos(75) ≈ 7.76 feet from the base. Flip the mode toggle and the same expressions return wildly different numbers — a fast way to confirm the mode setting matches your input units.
Error messages and common mistakes
'Invalid number' usually means a typo — two decimal points in a row, a stray letter, or scientific notation written without the e (write 1.5e3, not 1.5 × 10^3).
'Unexpected character' is the parser's catch-all for syntax it does not recognize: a smart-quote pasted from a word processor, an em-dash where a minus sign was intended, or a Greek π character. Replace with straight ASCII punctuation and the word 'pi'.
Division by zero returns Infinity, not an error — the JavaScript number type uses IEEE 754, which represents 1/0 as positive infinity. Multiplying that by anything finite still gives infinity; multiplying it by zero gives NaN ('not a number').
asin(2) returns NaN because the sine of a real angle is always between -1 and 1, so the inverse sine is only defined on that range. The same applies to acos. atan accepts any real input.
Floating-point rounding shows up most often in trig: cos(90) in degree mode returns about 6 × 10⁻¹⁷, not exactly zero, because π/2 cannot be represented exactly in binary. For symbolic exactness, use a CAS (Wolfram Alpha, SymPy). For engineering accuracy, the floating-point result is the correct answer.
Frequently asked questions
Why does sin(45) not equal exactly 0.7071…?
Floating-point arithmetic has limited precision (~15–16 significant digits). The displayed answer is correct to that precision; small rounding artifacts in the last digits are expected.
Can I do hex/binary math?
Not in this calculator — it operates on decimal real numbers only. For radix conversion or bitwise ops, use a programmer-mode calculator.
Does it support implicit multiplication like 2(3+4)?
No — write 2*(3+4) explicitly. The parser is strict to keep error messages clear.
Is the input safe? Does it use eval()?
No. The expression is parsed by a hand-written recursive-descent parser — there is no eval or Function call, so the calculator can't accidentally execute JavaScript.
How do I clear the input?
Click the C button or just delete the text in the expression field. Your last expression auto-saves to your browser, so refreshing won't lose it.
More in Math Tools
General-purpose math: percentages, percent change, averages, proportions, slope/grade, fractions, descriptive statistics, and a full scientific calculator.
- Percentage Calculator
Three modes: X% of Y, A is what % of B, and % change.
- Percentage Increase / Decrease Calculator
Percent change between any old and new value, with the formula and direction shown.
- Average Calculator
Mean, median, mode, sum, count, min, max, and range for any list of numbers.
- Proportion Calculator
Solve any proportion a/b = c/d for the missing value using cross-multiplication.
- Slope & Grade Calculator
Convert rise and run into decimal slope, percent grade, angle, and 1:N ratio — for ramps, roofs, roads, stairs.
- Fraction Calculator
Add, subtract, multiply, and divide fractions and mixed numbers — results returned simplified, as a mixed number, and as a decimal.
Related calculators
Browse all Education →T-Test Calculator
One-sample and two-sample t-tests with t-statistic, p-value, and rejection regions.
Sample Size Calculator
Required sample size to estimate a proportion or mean at a chosen confidence level and margin of error.
Fraction Calculator
Add, subtract, multiply, and divide fractions and mixed numbers — results returned simplified, as a mixed number, and as a decimal.
Standard Deviation Calculator
Mean, median, mode, range, sample/population standard deviation, variance, quartiles, IQR, and SEM for any list of numbers.
Course Grade Calculator
Weighted course grade from assignments, quizzes, and exams. Shows current grade plus the score needed on remaining work.
Area of a Circle Calculator
Find the area of a circle from its radius, diameter, or circumference with the exact formula A = π × r².
Circumference Calculator
Find the circumference of a circle from its radius, diameter, or area using C = 2 × π × r.
Cylinder Volume Calculator
Volume and surface area of any cylinder from its radius and height using V = π × r² × h.