Skip to main content
ponderloop

Scientific Calculator

2(3+4)^2 + sin(30) = 98.5 in degree mode: 2(3+4)^2 is 98 and sin(30) is 0.5. Type any expression and the answer appears as you type: + − × ÷, powers with ^, brackets, implicit multiplication such as 2(3+4) or 2pi, %, n!, mod, pi, e and Ans, and sin, cos, tan, their inverses, sinh, cosh, tanh, ln, log, log2, sqrt, cbrt, abs, exp, floor, ceil, round, nPr and nCr. Switch DEG, RAD or GRAD for the trig functions, press Enter to keep a result in the history, and use the memory keys to carry a number along.

Updated Runs in your browser: nothing you enter is uploadedHow this tool works

Type with the keyboard or the keys below. Enter saves the result to the history. Use ^ for powers, ! for factorial, pi, e and Ans.

2(3+4)^2 + sin(30) =

98.5

Result
98.5
Scientific notation
9.85e1
Read as
2 × (3 + 4)^2 + sin(30)
Angle unit
Degrees (DEG)

Angle unit

Memory is empty

History

  1. Nothing yet: press Enter or = to save a calculation here.

Scientific calculator functions

Each row is the calculator’s own answer for the example, in degree mode.
FunctionWhat it doesExampleResult
sin(x)Sine of an angle in the chosen unitsin(30)0.5
cos(x)Cosine of an angle in the chosen unitcos(60)0.5
tan(x)Tangent of an angle in the chosen unittan(45)1
asin(x)Inverse sine: the angle, in the chosen unit, whose sine is x (-1 to 1)asin(0.5)30
acos(x)Inverse cosine: the angle whose cosine is x (-1 to 1)acos(0.5)60
atan(x)Inverse tangent: the angle whose tangent is xatan(1)45
sinh(x)Hyperbolic sinesinh(1)1.17520119364
cosh(x)Hyperbolic cosinecosh(1)1.54308063482
tanh(x)Hyperbolic tangenttanh(1)0.761594155956
ln(x)Natural logarithm, base e (x above 0)ln(10)2.30258509299
log(x)Logarithm base 10 (x above 0); log10(x) is the samelog(1000)3
log2(x)Logarithm base 2 (x above 0)log2(1024)10
sqrt(x)Square root (x of 0 or more); √ is the samesqrt(144)12
cbrt(x)Cube root, also of a negative numbercbrt(-27)-3
abs(x)Absolute valueabs(-7.5)7.5
exp(x)e raised to the power xexp(1)2.71828182846
floor(x)Largest whole number not above xfloor(-2.5)-3
ceil(x)Smallest whole number not below xceil(-2.5)-2
round(x)Nearest whole number, halves away from zeroround(2.5)3
nPr(n, r)Permutations: ordered ways to pick r of nnPr(10,3)720
nCr(n, r)Combinations: unordered ways to pick r of nnCr(52,5)2598960
n!Factorial of a whole number n from 0 to 1,00010!3628800
x^yx to the power y; also written x**y2^101024
a mod bRemainder, with the sign of b-7 mod 32
x%x divided by 100200*15%30

Order of operations

From the strongest binding to the weakest. Each row is the calculator’s own answer for the example.
LevelOperatorsHow they groupExampleResult
1Brackets ( ) and function callsInnermost first(2+3)*420
2Postfix: ! % and the units deg, rad, gradBind to the number on their left2^3!64
3^ (power)Right to left: 2^3^2 is 2^(3^2)2^3^2512
4Unary - and + (a sign in front of a number)Weaker than ^, stronger than ×-2^2-4
5× ÷ mod, and implicit multiplication (2(3+4), 2pi)Left to right6/2(1+2)9
6+ -Left to right10-4-33

Constants, Ans and angle units

Each row is the calculator’s own answer for the example.
NameMeaningExampleResult
pi (or π)The ratio of a circle’s circumference to its diameterpi3.14159265359
eEuler’s number, the base of the natural logarithme2.71828182846
AnsThe result of the last calculation saved with Enter or =Ans*2 when the last result was 12.525
degAn angle in degrees, converted to the chosen unit180 deg in RAD mode3.14159265359
radAn angle in radians, converted to the chosen unitpi rad in DEG mode180
gradAn angle in gradians, converted to the chosen unit100 grad in DEG mode90
1e3, 2.5e-4Scientific notation: a number, e, an exponent1.5e31500

Degrees, radians and gradians

The same angles in each unit, as the calculator answers in that mode.
Angle unitA full turn (360°)A right angle (90°)asin(1)sin(30 deg)
Degrees (DEG)36090900.5
Radians (RAD)6.283185307181.570796326791.570796326790.5
Gradians (GRAD)4001001000.5

How results are rounded and shown

Each result is the calculator’s own answer.
ExpressionShowsRule
0.1+0.20.3The answer is rounded to 15 significant digits, then shown with 12
0.3-0.1-0.20A difference far smaller than its operands is rounding error, so it is 0
sin(180 deg)0Exact at quarter turns in DEG and GRAD
sin(pi)0In RAD mode a tiny sine or cosine of a large angle is noise, so it is 0
1/30.33333333333312 significant digits, trailing zeros dropped
2^53+19.00719925474e15Whole numbers are exact up to 10,000 bits; the Exact value row shows every digit
100!9.33262154439e157Over 12 digits: scientific notation, with the exact digits listed
1e121e12From 1e12 up, scientific notation
0.00000011e-7Below 0.000001, scientific notation

Error messages

What the calculator says instead of a wrong or empty answer. Each message is the calculator’s own.
ExpressionMessage
1/0Division by zero at position 2: nothing can be divided by 0
sqrt(-1)sqrt needs a value of 0 or more: the square root of -1 is not a real number (position 1)
log(0)log(0) is undefined: the logarithm of 0 tends to minus infinity (position 1)
tan(90)tan is undefined at 90 degrees: its cosine is 0 (position 1)
(1+2Unbalanced parentheses: the “(” at position 1 is never closed
1+2)Unbalanced parentheses: the “)” at position 4 has no matching “(”
foo(2)Unknown name “foo” at position 1: it is not a function or a constant (see the function table on this page)
2 3Missing operator between “2” and “3” at position 3: put +, -, * or / between them
1001!Factorial is limited to n = 1,000 here, but got 1,001 (position 5)

Keyboard shortcuts

KeyWhat it does
EnterSave the result to the history and clear the box (the result stays above as Ans)
EscClear the expression
Up arrow, Down arrowStep back and forward through earlier expressions
+ * / ^ in an empty boxContinue from the last result: typing * gives Ans*
TabMove through the angle unit, memory keys and keypad; Space or Enter presses a key
**, ², ³, √, π, ×, ÷, −Typed or pasted, these mean ^, ^2, ^3, sqrt, pi, *, / and -
A trailing =Ignored, so 2+2= works

How to use the scientific calculator

  1. Pick the angle unit. Choose DEG, RAD or GRAD above the keys before using sin, cos, tan or their inverses. 2(3+4)^2 + sin(30) is 98.5 in degrees, because sin(30) is 0.5; sin(30) in radians is -0.988031624093.
  2. Type the expression. Type with the keyboard or tap the keys, brackets included: 2(3+4)^2 + sin(30). Write 2(3+4) or 2pi without a ×; the “Read as” line under the result shows how the calculator understood it.
  3. Read the live result. The answer updates after every key. If something is wrong, the message names the problem and marks where it is, for example “Unbalanced parentheses: the “(” at position 1 is never closed”.
  4. Save it with Enter. Press Enter or = to keep the result in the history. Tap an expression in the history to edit it again, or its result to insert the number.
  5. Reuse results. Type Ans for the last result, or use M+, M−, MR and MC to add to, subtract from, recall and clear the memory. Copy result puts the answer on the clipboard.

Frequently asked questions

How do I switch between degrees and radians?
Use the DEG, RAD and GRAD buttons above the keys. The unit applies to sin, cos and tan, and the inverses asin, acos and atan answer in it. sin(30) is 0.5 in degrees but -0.988031624093 in radians and 0.45399049974 in gradians. You can also write the unit after a number: sin(30 deg) is 0.5 in every mode, because 30 deg is converted to the current unit first, so you never have to switch for a single angle. A full turn is 360 degrees, 6.28318530718 radians or 400 gradians. The unit you pick is remembered in this browser.
What is the order of operations on this calculator?
Brackets and function calls first, then the postfix operators (!, %, deg), then powers (^) from right to left, then a minus sign in front of a number, then multiplication, division, mod and implicit multiplication from left to right, and last addition and subtraction from left to right. So 1+2*3 is 7, (1+2)*3 is 9, -2^2 is -4 and (-2)^2 is 4. The table above lists the levels with the calculator’s own answers.
Why is 2^3^2 equal to 512 and not 64?
The power operator groups from right to left, as it does in mathematics: 2^3^2 means 2^(3^2) = 2^9 = 512. Grouping from the left, (2^3)^2, would give 64. Add brackets if you want the left-to-right reading. The “Read as” line shows the expression the calculator actually evaluated.
Why does 0.1 + 0.2 show 0.3 and not 0.30000000000000004?
Computers store numbers as binary fractions (IEEE 754 double precision, about 15 to 17 significant digits), and 0.1 and 0.2 have no exact binary form, so a plain addition gives 0.30000000000000004. This calculator rounds every final answer to 15 significant digits and shows 12, so 0.1+0.2 is 0.3. Two more rules remove noise: a difference smaller than 1e-15 times its operands is treated as 0 (0.3-0.1-0.2 is 0), and trig results are exact at quarter turns (sin(180 deg) is 0). Real differences are never hidden: 1e-10+1e-11 is 1.1e-10.
How do I enter exponents, roots and scientific notation?
Use ^ (or **) for a power: 2^10 is 1024, 2^-2 is 0.25 and 10^3 is 1000. x² and 10ˣ are keys that type ^2 and 10^. For roots use sqrt(x) or √, cbrt(x), or a fractional power: 27^(1/3) is 3. For scientific notation type a number, e and the exponent: 1.5e3 is 1500 and 2.5e-4 is 0.00025. A number directly followed by e and digits is always read as scientific notation, so write 2*e to multiply by Euler’s number (2*e is 5.43656365692, while 2e3 is 2000).
How large a factorial can it calculate?
Whole-number factorials from 0! to 1,000! are computed exactly with big integers: 1,000! has 2,568 digits, and the Exact value row lists them all. 170! (7.25741561531e306) is the largest factorial a plain double can hold, 171! (1.24101807022e309) is beyond it, and this calculator still gives it exactly. Above 1,000 it stops with the message “Factorial is limited to n = 1,000 here, but got 1,001 (position 5)”. Factorial needs a whole number, so 2.5! is refused (“Factorial needs a whole number for n, but got 2.5 (position 4)”) rather than guessed. nPr and nCr use the same limit.
What does implicit multiplication mean, and how is 1/2pi read?
Writing two terms next to each other multiplies them: 2(3+4) is 14, 2pi is 6.28318530718 and (1+2)(3+4) is 21. It has the same rank as × and ÷ and is evaluated left to right, so 1/2pi is (1÷2)×pi = 1.57079632679, not 1÷(2pi) = 0.159154943092; and 6/2(1+2) is 9. Write the brackets, as in 1/(2pi), whenever you mean the second reading. Two bare numbers such as “2 3” are not multiplied: that is almost always a typing slip, so the calculator asks for an operator.
How precise is this calculator?
Numbers are IEEE 754 doubles, which hold about 15 to 16 significant digits. Answers are shown with up to 12 significant digits (1/3 is 0.333333333333) and the Full precision row shows 15. Whole numbers are different: when every number in a calculation is a whole number and you only add, subtract, multiply, divide evenly, raise to a whole power or take a factorial, the result is exact up to 10,000 bits (about 3,000 digits). That is why 2^53+1 is exactly 9007199254740993, a number a plain double cannot store. Functions such as sin, ln and sqrt are typically accurate to about 15 digits, and tan loses digits close to 90 degrees, where it changes very quickly.
Why do I get an error for sqrt(-1), log(0) or 1/0?
These have no real answer, and the calculator says so instead of printing a meaningless value. sqrt(-1) gives “sqrt needs a value of 0 or more: the square root of -1 is not a real number (position 1)”; log(0) gives “log(0) is undefined: the logarithm of 0 tends to minus infinity (position 1)”; and 1/0 gives “Division by zero at position 2: nothing can be divided by 0”. Each message gives the position of the problem, and the page shows the expression with the faulty part marked. Decimal results above about 1.79769313486e308 are refused too (whole numbers can go further, to about 3,000 digits). This is a real-number calculator: it does not do complex numbers.
What does % do, and how is it different from mod?
% is a postfix operator that divides by 100: 50% is 0.5 and 200*15% is 30. It does not take a percentage of the number before it, so 50+10% is 50.1; write 50+50*10% (55) for “50 plus 10% of 50”. mod is the remainder: 17 mod 5 is 2, and the result has the sign of the divisor, so -7 mod 3 is 2 and 7 mod -3 is -2.
How do I calculate permutations and combinations?
Type nPr(n, r) for the number of ordered selections and nCr(n, r) for unordered ones: nPr(10,3) is 720 and nCr(52,5), the number of five-card hands from a deck, is 2598960. Both are exact for n up to 1,000: nCr(100,50) is 1.00891344546e29 and its Exact value row shows all 30 digits. r must be a whole number from 0 to n.
How do Ans, the memory keys and the history work?
Enter (or =) saves a result and clears the box; the result stays on screen and Ans stands for it, so after 12.5 the expression Ans*2 is 25. Typing + * / or ^ in an empty box starts with Ans for you. M+ and M− add the current result to, or subtract it from, the memory, MR types the memory value into the box and MC clears it. The history keeps your last 50 calculations: tap an expression to edit it again or a result to insert the number, and Clear history removes them.
Is anything I type stored or sent anywhere?
No calculation leaves your device: everything is worked out in your browser. The angle unit, the history and the memory are saved in this browser’s local storage so they are still there on your next visit, and nowhere else. Clear history removes the history, and clearing the site’s data in your browser removes the rest. The calculator works the same, without remembering anything, if storage is blocked.

How it works

The expression is split into tokens and evaluated by a recursive-descent parser written for this page; it never uses eval or the Function constructor, so nothing you type can run as code. The grammar, from weakest to strongest: sum (+ -), product (× ÷ mod and implicit multiplication, left to right), sign (unary - and +), power (^, right to left, whose exponent may carry its own sign, so 2^-2 works), postfix (!, %, deg, rad, grad), then a number, a constant, Ans, a bracketed expression or a function call. A function name followed by a single term works without brackets (sin 30, sqrt 16). Names are not case sensitive. The inputs × ÷ − ** π √ ² ³ ° and a trailing = are understood. Numbers: every value is an IEEE 754 double, and next to it the engine keeps an exact BigInt whenever the value is a whole number it knows exactly (integer literals, + - × mod abs floor ceil round, a power with a whole exponent of 0 or more, a division that comes out even, n!, nPr and nCr). Exact results may have up to 10,000 bits, about 3,000 digits; factorial, nPr and nCr go up to n = 1,000; an exact value too big for a double can be shown but not mixed with decimals. Noise rules: after + or - on doubles, a result smaller than 1e-15 times the larger operand is the cancellation of rounding errors and becomes 0; sin, cos and tan are exact at multiples of a quarter turn in DEG and GRAD (so tan(90) is undefined), and in every mode a sine or cosine below 1e-15 times the larger of 1 and the angle in radians, for an angle of 0.001 rad or more, becomes 0; floor and ceil treat a value within 1e-12 of a whole number as that number; inverse trig results in DEG and GRAD and every final answer are rounded to 15 significant digits. Display: up to 12 significant digits with trailing zeros dropped, written in full from 0.000001 to 999,999,999,999 and in scientific notation (1.23456789012e12) outside that range; whole numbers print in full up to 12 digits and above that in scientific notation with the exact digits listed. Angle units: a full turn is 360 (DEG), 2π (RAD) or 400 (GRAD); x deg, x rad and x grad convert x to the current unit before it is used. Domain errors (square root of a negative number, logarithm of 0 or less, asin and acos outside -1 to 1, division by zero, a negative base with a fractional exponent, factorial of a non-integer) and results too large for a double are reported with a message and the position, never as a number. Expressions are limited to 300 levels of nesting. Everything runs in your browser; the angle unit, the history (the last 50 calculations) and the memory are kept in its local storage, and no expression or result is sent anywhere.

Sources

More: Algebra and number theoryAll math & numbersAll toolsHome & DIY calculators