Calculators
Scientific Calculator
A free online scientific calculator for trigonometry, logarithms, powers, roots, factorials and constants like π and e. Type with your keyboard or tap the keys, switch between degrees and radians, and get instant results.
Tip: you can type directly with your keyboard, including function names such as asin( and sqrt(. Enter = equals, Esc = clear.
How to evaluate an expression
- Build the expression with the keypad or by typing. The keyboard accepts digits, the decimal point, + - * / ^ ( ) ! and the letters of the function and constant names (sin, asin, sqrt, pi, e and so on); a letter that cannot form a known name is ignored.
- Function keys insert the name with an opening bracket, for example sin(. Type the argument and close the bracket yourself, or the result will be Error.
- Choose Degrees or Radians before evaluating. The mode is applied when you press =, and switching it afterwards does not recalculate the previous result.
- Press = or Enter to evaluate. The expression stays on the top line and the result appears beneath it; C or Esc clears everything and ⌫ or Backspace removes the last character.
Operator precedence as the parser applies it
Expressions are tokenised and converted to reverse Polish notation with a shunting-yard parser, then evaluated on a stack. No JavaScript eval is involved, which is why only the symbols listed here are understood. The binding order from tightest to loosest is: factorial, exponent, a leading unary minus, multiplication and division, then addition and subtraction.
Two details of this ordering are worth knowing. -3! evaluates to -6 because the factorial is applied before the sign, and -2^2 is -4 because a leading minus waits for the power. A minus that directly follows another operator is different: it is attached to the value after it, so 2^-1 gives 0.5 and 2^-2 gives 0.25 with no brackets needed.
| Operator | Binds | Example | Result |
|---|---|---|---|
| ! (factorial) | Tightest, applies to the value just before it | 2^3! | 64 |
| ^ (power) | Right to left | 2^3^2 | 512 |
| Unary minus | Below ^ when it leads; a sign straight after an operator binds to the next value | -2^2 and 2^-1 | -4 and 0.5 |
| * and / | Left to right | 10/3*3 | 10 |
| + and - | Left to right, loosest | 2+3*4 | 14 |
| ( ) | Overrides everything | (2+3)*4 | 20 |
Precedence and associativity in lib/calculator.ts, with the result the calculator shows.
Functions, constants and the angle mode
The second row of the keypad holds asin, acos, atan, abs and exp. The inverse trig functions return an angle in the current mode, so asin(1) is 90 in Degrees and 1.5707963268 in Radians, and an argument outside -1 to 1 for asin or acos is reported as Error. abs strips the sign, and exp(x) raises e to the power x, so exp(1) matches the e constant.
In Degrees mode the argument is multiplied by π/180 before the trig function runs; in Radians mode it is used as typed. sin(30) is 0.5 in degrees but -0.988031624093 in radians, and sin(pi/2) is 1 in radians but 0.027412133592 in degrees. Check the highlighted button before trusting a trig result.
| Key | Inserts | Meaning | Example in Degrees mode |
|---|---|---|---|
| sin, cos, tan | sin( cos( tan( | Trigonometric functions | sin(30) = 0.5 |
| asin, acos, atan | asin( acos( atan( | Inverse trig, returns an angle in the current mode | asin(1) = 90 |
| abs | abs( | Absolute value | abs(-4) = 4 |
| exp | exp( | e raised to the argument | exp(1) = 2.71828182846 |
| ln | ln( | Natural logarithm, base e | ln(e) = 1 |
| log | log( | Common logarithm, base 10 | log(1000) = 3 |
| √ | sqrt( | Square root | sqrt(16) = 4 |
| xʸ | ^ | Power | 2^0.5 = 1.41421356237 |
| x! | ! | Factorial of a non-negative integer | 5! = 120 |
| π | pi | 3.14159265359 | 2*pi = 6.28318530718 |
| e | e | 2.71828182846 | e^2 = 7.38905609893 |
Everything the keypad can insert. Trig functions convert the argument according to the Degrees/Radians buttons.
Precision and how results are displayed
- Results are shown to 12 significant digits, so 1/3 appears as 0.333333333333 and sin(30) comes out as a clean 0.5 rather than the 0.49999999999999994 the raw floating-point maths produces.
- Large integers lose digits beyond the twelfth: 2^50 is displayed as 1125899906840000, while the true value is 1125899906842624.
- Floating-point residue can survive the rounding. cos(90) in Degrees mode shows 6.12323399574e-17 rather than 0, and tan(90) shows 16331239353200000 rather than an error, because π/2 cannot be represented exactly.
- Factorials are computed by multiplication up to 170! = 7.25741561531e+306; 171! and beyond display Infinity. Dividing by zero also shows Infinity, and log(0) shows -Infinity.
- Scientific notation is understood when the e sits between digits: 1.5e3*2 evaluates to 3000. On its own, e is the constant.
Why the display says Error
- An unclosed bracket, such as sin(30 without the closing parenthesis, is reported as mismatched.
- Implied multiplication is not supported: 2pi or 2(3+4) is invalid, so write 2*pi and 2*(3+4).
- A factorial of a negative number or a non-integer, such as 3.5!, is rejected.
- Any operation that produces a non-number, such as sqrt(-1) in the real numbers, is shown as Error rather than NaN.
- An inverse sine or cosine of a value outside -1 to 1, such as asin(2), has no real answer and is shown as Error.
Worked examples you can type in
- Compound growth: 100*1.05^10 gives 162.889462678, the value of 100 after ten years at 5%.
- Combinations: 5!/(3!*2!) gives 10, the number of ways to choose 2 items from 5.
- Right triangle: sqrt(3^2+4^2) gives 5, and in Degrees mode tan(45) gives 1.
- Circle circumference with radius 5: 2*pi*5 gives 31.4159265359.
Frequently asked questions
What can this scientific calculator do?
It handles arithmetic, parentheses, powers and roots, factorials, trigonometry (sin, cos, tan and their inverses), logarithms (log and ln), and the constants π and e.
How do I switch between degrees and radians?
Use the Degrees/Radians toggle above the keypad. It changes how trigonometric functions interpret angles, so pick the one your problem uses.
Can I type with my keyboard?
Yes. You can type numbers, operators and function names such as sin( or sqrt( directly; press Enter to calculate and Esc to clear, or use the on-screen keypad.
Is it free and private?
Completely. Every calculation runs in your browser — nothing is uploaded — and there's no sign-up or limit.
Do I need brackets around a negative exponent?
No. A minus directly after ^ is read as the sign of the exponent, so 2^-1 returns 0.5 and 10^-3 returns 0.001; 2^(-1) still works if you prefer it. A minus at the very start of the expression behaves differently: -2^2 is -4, because the power is applied before the leading sign.
How do I enter a number in scientific notation?
Type the mantissa, press the e key, then type the exponent with no spaces, for example 1.5e3 for 1,500. The e is read as part of the number only when digits follow it directly; e by itself is Euler's number.
Why is tan(90) a huge number instead of an error?
90 degrees is converted to π/2 radians, which cannot be stored exactly in binary floating point. The tangent of the nearest representable value is about 1.6 × 10^16, so that is what the display shows.
Can I use the inverse trig functions asin, acos and atan?
Yes. The second keypad row inserts asin(, acos( and atan(, and the letters can also be typed on the keyboard. The result is an angle in whichever mode is highlighted: acos(0.5) is 60 in Degrees and 1.0471975512 in Radians.
Explore
113 tools. Zero uploads. One place.
Every tool opens instantly, works on your phone and keeps your files on your device.
Related tools
Age Calculator
Calculators
Calculate your exact age in years, months and days.
Open toolDate Calculator
Calculators
Find the difference between two dates, or add/subtract days.
Open toolPercentage Calculator
Calculators
Work out percentages, increases and decreases.
Open toolBMI Calculator
Calculators
Calculate your Body Mass Index in metric or imperial.
Open tool