Scientific Calculator
Free web tool: Scientific Calculator
Scientific Calculator
About Scientific Calculator
This scientific calculator uses a text-expression input model: you type complete mathematical expressions like "sin(45) + log(100)" and press = to evaluate them. It supports trigonometric functions (sin, cos, tan), inverse trig (asin, acos, atan), base-10 logarithm (log), natural logarithm (ln), square root (sqrt), absolute value (abs), and factorial (n!). Mathematical constants pi and e can be used by typing their names. Exponentiation is written with ^ (e.g., 2^8).
The calculator targets students and professionals who prefer typing full expressions over pressing individual buttons. The display area shows the current expression on top and the computed result below. A calculation history panel keeps the last 10 completed calculations, showing both the input expression and the result, making it easy to review or reuse previous computations.
Expressions are sanitized before evaluation by replacing function names with their Math object equivalents (e.g., sin( becomes Math.sin(), log( becomes Math.log10()). The result is computed using JavaScript's Function constructor with strict mode for safe evaluation. Results are formatted to 12 significant figures, infinite values are shown as "Infinity", and any evaluation error is shown as "Error".
Key Features
- Expression-based input: type full formulas like "sqrt(2)*sin(45)+log(100)"
- Trigonometric functions: sin, cos, tan (radians-based, use pi for π)
- Inverse trig functions: asin, acos, atan for arc calculations
- Logarithms: log (base 10) and ln (natural logarithm)
- sqrt for square root and abs for absolute value
- Factorial (n!) button for integer factorial calculations
- Constants: type "pi" for π and "e" for Euler's number
- Calculation history: last 10 results displayed with expression and value
Frequently Asked Questions
How do I enter a trigonometric function?
Type the function name followed by the argument in parentheses: sin(1.5708), cos(0), tan(0.7854). Note that this calculator uses radians by default — there is no DEG/RAD mode switch. To compute sin(45°), convert to radians first: sin(45*pi/180).
What is the difference between log and ln?
Typing "log(" evaluates the base-10 (common) logarithm, equivalent to Math.log10(). Typing "ln(" evaluates the natural logarithm (base e), equivalent to Math.log(). So log(1000) = 3 and ln(e) = 1.
How do I type pi and e?
Type "pi" (lowercase) to use the mathematical constant π ≈ 3.14159265359. Type "e" (lowercase) to use Euler's number ≈ 2.71828182846. You can use them in expressions: 2*pi*5 computes the circumference of a circle with radius 5.
How does the factorial (n!) button work?
Enter an integer in the expression field, then press the n! button. The calculator computes the factorial of that integer. Valid range is 0 to 170. Entering 10 and pressing n! displays 3628800. Values above 170 will show Error because they exceed JavaScript's floating-point range.
Does this calculator support chained or nested expressions?
Yes. You can write nested expressions like sqrt(sin(pi/6)^2 + cos(pi/6)^2) and they will evaluate correctly. The expression is fully parsed by JavaScript's math engine after function name substitution.
How do I delete a character or clear the expression?
Press the DEL button to remove the last character from the expression. Press the C button to clear both the expression and result fields completely. The history panel is not affected by C — it persists until the page is refreshed.
What does the history panel show?
The history panel shows up to 10 recent calculations, each as "expression = result". New calculations are added at the top. The history is stored in React state and resets when you refresh the page. You can use it to verify previous results or manually re-enter a past expression.
Can I use the % operator?
Yes. The % operator is available and works as the modulo or percentage operator as supported by JavaScript. For example, 10%3 = 1 (remainder of 10 divided by 3). You can also chain it with other operations: 100*1.1%2 evaluates left to right per operator precedence.