Scientific calculator
Evaluate expressions with powers, roots, logs and trigonometry locally. Only the listed syntax is supported; results are rounded.
Runs entirely in your browser
0
More functions
Keyboard: type the expression, then Enter or = to calculate. Escape clears. After a result, starting with an operator continues from Ans; starting with a digit begins afresh. 6/2(1+2) is read as 9, with implicit multiplication ranking with × and ÷; some calculators give 1.
History
Calculations you finish appear here. Click one to reuse its expression.
Results are rounded to 12 significant digits and range up to about 1.8e308. Factorials stop at 170!. The expression is parsed by the page itself, with no eval, so only the operators and functions listed here are understood.
How to use the scientific calculator
- Type an expression such as
2(3+4)^2with your keyboard, or tap the keys. Choose Degrees or Radians first if you are using sin, cos or tan. - Press = or Enter. A small note appears if closing brackets were added for you, and any mistake is explained in plain words.
- Use Ans to carry the last result into the next calculation, or tap an earlier line in the history to reuse its expression.
How an expression is read
A calculator does not simply work left to right. It first breaks the text into numbers, operators and names, then builds a tree in which tighter-binding operations sit deeper, and finally evaluates the tree from the bottom up. This page does exactly that in its own code, without handing your text to a general-purpose evaluator. From loosest to tightest, the order is: addition and subtraction; multiplication, division and implicit multiplication; a minus sign in front of a value; powers; factorial and percent.
Powers group from the right, so 2^3^2 means 2^(3^2) = 512, not (2^3)^2 = 64. A minus sign in front of a power applies after it, so −2^2 is −4. Functions need brackets, as in sin(30), and a missing closing bracket at the very end is added for you with a note, so typing (2+3 gives 5. Anything that cannot be a real number is stopped with an explanation rather than shown as Infinity or NaN.
Trigonometry depends on the angle unit. In degrees, sin(30) is 0.5; in radians the same input means 30 radians and gives −0.988. Switch the unit before you start, and remember the inverse functions return angles in the chosen unit. Computers store most decimals in binary, which is why 0.1+0.2 would be 0.30000000000000004 in raw floating point; every answer here is rounded to 12 significant digits first.
Tips
- To add 15% to a price or find a change between two values, the percentage calculator shows the formula it uses.
- Need exact answers for sums such as 1/3 + 2/7 instead of rounded decimals? Use the fraction calculator.
- Working with binary, octal or hexadecimal? The number base converter handles those bases.
Reference: JavaScript math functions.
Questions
What does 6 ÷ 2(1 + 2) equal here?
9. This calculator gives implicit multiplication, where the × sign is left out as in 2(1+2), the same rank as × and ÷ and works left to right, so 6 ÷ 2 comes first and is multiplied by 3. Some calculators and textbooks bind the juxtaposition tighter and get 1. Neither is a mistake in arithmetic, only a different convention, so add brackets if the expression will be read by others: 6/(2(1+2)) is 1, and (6/2)(1+2) is 9.
Why is −2^2 equal to −4 and not 4?
The power is worked out before the minus sign is applied, so −2^2 means −(2^2). To square a negative number, put it in brackets: (−2)^2 = 4. A power next to a minus sign on its right is fine: 2^−1 is 0.5. Chained powers group from the right, so 2^3^2 is 2^(3^2) = 512.
How does the percent key work?
% divides the number before it by 100, wherever it appears. 50% is 0.5 and 200*10% is 20. It does not add or subtract the percentage the way a pocket calculator does with 200+10%; here that is 200.1. For increases and decreases use the percentage calculator.
Why does sin(30) give exactly 0.5 but sin(π) give 0?
Floating-point arithmetic cannot store π exactly, so sin of the stored value comes out as 1.2e-16, not 0. The calculator treats trig results that are tiny relative to the input angle as 0, while keeping small nonzero results such as sin(1e-16) in radians. Every answer is rounded to 12 significant digits, so 0.1+0.2 shows 0.3 instead of 0.30000000000000004. In degree mode, angles such as 30, 90 and 180 are also reduced exactly, and tan(90) is reported as undefined rather than as a huge number.