Scientific Calculator Online Free

📏 Math Tools ✔ Free Forever

Scientific Calculator Online Free

A full scientific calculator in your browser. Trig functions, logarithms, exponents, factorials, constants, angle mode toggle, and a history log. Works on any device instantly.

✔ sin, cos, tan, their inverses ✔ log, ln, exp ✔ DEG and RAD modes ✔ Calculation history ✔ Keyboard support
0
History
No calculations yet
About This Tool

How this scientific calculator turns typed expressions into safe, evaluated results

Under the hood, this calculator does not implement its own recursive descent parser with a hand built grammar. Instead it takes a more pragmatic approach: it rewrites your expression, function names, constants, angle mode, factorials, into plain JavaScript syntax, then hands the rewritten string to a dynamically constructed Function that evaluates it. It is effectively a controlled, sandboxed eval, and understanding that rewrite step is the key to understanding exactly what this calculator can and cannot do.

Every keystroke and calculation happens in your browser. Nothing is transmitted anywhere, and your calculation history lives only in this page’s memory until you leave or clear it.

From typed expression to evaluated number

Step 1 Substitute constants Occurrences of “pi” and the standalone word “e” are replaced with their literal decimal values, 3.141592653589793 and 2.718281828459045, wrapped in parentheses so they behave correctly next to surrounding operators.
Step 2 Route trig functions through angle-aware wrappers sin(, cos(, tan(, and their inverse forms are not sent straight to JavaScript’s Math object, because Math always works in radians. Instead they are replaced with placeholder function names that get bound at evaluation time to wrapper functions checking whether you are in degree or radian mode.
Step 3 Rewrite remaining functions and operators sqrt(, abs(, and exp( map directly onto their Math equivalents. log( maps to Math.log10 (base-10 log, the scientific calculator convention), ln( maps to Math.log (natural log). The caret ^ is rewritten to JavaScript’s exponent operator **, and n! factorial notation is resolved immediately by computing the factorial and substituting the literal number.
Step 4 Evaluate inside a constructed Function The final rewritten string is passed into new Function(...) along with the trig wrapper functions and the Math object as explicit parameters, then invoked. This keeps the evaluation out of the page’s normal global scope, which is a narrower blast radius than a raw eval() call, though it is still fundamentally dynamic code execution rather than a parsed expression tree.
// angle-aware trig wrapper, bound at eval time var sinFn = scMode === ‘deg’ ? function(x){ return Math.sin(x * Math.PI / 180); } : function(x){ return Math.sin(x); }; // rewriting ^ to JS exponentiation and n! to a resolved literal expr = expr.replace(/\^/g, ‘**’); expr = expr.replace(/(\d+(\.\d+)?)\s*!/g, function(m, n){ return String(factorial(parseFloat(n))); }); // sandboxed evaluation, not a raw global eval() var fn = new Function(‘__scSin__’,’__scCos__’, /* …more params */ ‘Math’, ‘return (‘ + expr + ‘);’);
Typed inputRewritten toNotes
sin(30)__scSin__(30)Degrees or radians per current mode
2^102**10JS exponent operator
5!120Factorial resolved before evaluation
log(100)Math.log10(100)Base-10, not natural log
Why display precision is capped at 12 significant digits. JavaScript numbers are IEEE 754 double-precision floats, which cannot represent every decimal value exactly, the classic example being 0.1 + 0.2 producing 0.30000000000000004 instead of a clean 0.3. Rather than show that noise, the calculator runs every result through result.toPrecision(12) before display, then parses it back to trim trailing artifacts. This does not fix the underlying floating point representation, it just keeps the visible answer from exposing binary rounding error that has nothing to do with your actual calculation.
Degree and radian toggle

Because the trig substitution happens through bound wrapper functions rather than being hardcoded, switching angle mode changes how every subsequent sin, cos, tan, and their inverses are interpreted without altering the expression text itself.

Calculation history

The last 50 evaluated expressions are kept in memory and clickable, letting you reload a previous result back into the input line to build on it, a lighter version of a graphing calculator’s answer memory.

Sandboxed Function evaluation Degree / radian toggle IEEE 754 double precision
  • IEEE 754 is the floating point standard behind every JavaScript number and the reason results are rounded for display.
  • MDN: the Function constructor documents the dynamic evaluation mechanism this calculator relies on.
  • Order of operations is handled implicitly here by delegating to JavaScript’s own operator precedence rather than a custom-built parser.

Calculations this handles

Working trigonometry homework where you need to switch between degrees and radians quickly, checking an engineering calculation involving logarithms or exponents, verifying a quick physics formula with mixed operations without opening a full spreadsheet, and running exploratory arithmetic where keeping a visible history of prior steps matters more than a single throwaway answer. Anywhere you would normally reach for a handheld scientific calculator, this covers the same ground from a browser tab.

Common Questions

FAQ: Scientific Calculator Online Free

Yes, completely free. No account, no signup, and no payment required at any point.

Use DEG when your angles are in degrees, which is the default for most everyday problems and most high school level work. Use RAD when working in radians, which is standard in calculus, physics, and most programming environments. The mode affects all trig functions and their inverses.

Yes. Numbers, operators, parentheses, Enter for equals, Backspace to delete, and Escape to clear all work from your keyboard. This makes the calculator much faster for long calculations.

log is the logarithm base 10, also written log10. It asks how many times you need to multiply 10 by itself to get x. ln is the natural logarithm, base e. It uses the constant e (approximately 2.718) instead of 10 and appears frequently in calculus, physics, and finance.

Type the number then press the n! button. For example, type 5 then n! to get 120. Factorial is only defined for non-negative integers. The maximum supported value is 170 since 171! exceeds the maximum floating point number.

Yes. Click any entry in the history panel on the right to load that result back into the input. From there you can continue building a new expression with it.

Privacy Overview

Cookies let this site remember your preferences and show us which tools people actually use. Full detail sits in our Privacy Policy.