Scientific Calculator
Full-featured scientific calculator with trigonometry, logarithms and more.
Reviewed by Aygul Dovletova · Last reviewed
Using the Scientific Calculator
- Click the on-screen buttons or type directly with your keyboard. Digits, the four arithmetic operators, parentheses, and the caret for powers all work.
- Call a function by tapping its named key -
sin,cos,tan,log,ln, or√- then the argument, then the closing parenthesis. The display previews the expression as you build it. - Insert a constant with the π or
ekey. They expand to the full double-precision value, not a truncated 3.14 or 2.71. - Press = or Enter to evaluate. The expression plus its answer is pushed to the history strip above; the last five calculations stay visible for reuse.
- Edit with Backspace (the left-arrow key on the keypad) to remove the last character, or C to clear the entire expression. Escape also clears.
What Happens When You Press Equals
The calculator implements a small recursive-descent parser in TypeScript rather than delegating to JavaScript's eval. Tokens are scanned left-to-right into numbers, operators, function names, and parentheses; a shunting-yard-style precedence table then lowers the token stream into an AST of binary and unary nodes before evaluation. This matters for security (the display can never execute arbitrary JS) and for correctness (the parser enforces ISO 80000-2 operator precedence rather than inheriting JavaScript's quirks like 0.1 + 0.2 !== 0.3, which you will still see in the output because it is a property of IEEE 754 binary64 arithmetic).
Trig, log, and root functions call straight through to Math.sin, Math.cos, Math.log10, Math.log, and Math.sqrt, so you get whatever your engine uses: V8 (Chrome, Edge), SpiderMonkey (Firefox), or JavaScriptCore (Safari). All three implement IEEE 754 elementary functions to roughly one ULP, which is why sin(π) prints as a tiny number near 10-16 instead of a clean zero.
When a Scientific Calculator Is the Right Choice
- Checking homework on trigonometric identities or quickly evaluating
tan(π/4). - Converting decibels or pH:
log(x)gets you base-10,ln(x)/ln(10)if you forget there is a dedicated key. - Computing compound interest with
(1 + r)^nwithout firing up a spreadsheet. - Sanity-checking a numeric result from a longer calculation in Python, Excel, or Wolfram.
- Prototyping on a phone or tablet where the OS calculator refuses to rotate or lacks trig functions.
- Teaching order of operations to a student, with the history strip showing exactly how expressions parse.
Gotchas and Floating-Point Precision
- Radians, not degrees.
sin(90)returns0.893..., not 1. Convert withangle * π / 180or typesin(π/2)directly. - Binary floats can't represent 0.1 exactly.
0.1 + 0.2evaluates to0.30000000000000004in every IEEE 754 engine. This is arithmetic reality, not a bug. - Subtractive cancellation.
1 + 1e-16 - 1returns 0, because the intermediate result rounds to 1 at double precision. Reorder your expression to avoid cancelling a big number against a tiny one. - Division by zero returns
Infinity, not an error, following the IEEE 754 spec.0/0returnsNaN. Both render as readable strings. - Implicit multiplication is not supported. Write
2*(3+4), not2(3+4); the latter is treated as a call to a non-existent function. - Negative powers of negative bases are tricky:
(-2)^0.5isNaNbecause the result is complex, while(-2)^2is4. The tool does not do complex arithmetic.
A Brief History of Calculator Notation
What the calculator implements is the infix algebraic notation standardized by Hewlett-Packard's competitor Texas Instruments in the SR-50 (1974), and formalized in ISO 80000-2 for mathematical signs and symbols. That standard defines precedence (unary minus and exponentiation above multiplication, multiplication above addition, left-to-right within a tier), the meaning of log as base-10 outside pure mathematics, and the convention that sin applied without an argument in parentheses is malformed. HP's original 1968 machines used Reverse Polish Notation (RPN) instead, which needs no parentheses at all; RPN survives in stack-based languages and some trader keyboards but lost the consumer war.
Browser Calculator vs. The Alternatives
A physical calculator (TI-30, Casio fx-991) runs its evaluator on fixed-point BCD hardware and can be more accurate for long chains of division; a scientific calculator app like PCalc offers programmable memory and unit conversion; a desktop REPL (Python with math, Julia, or the Windows Calculator in Programmer mode) is better for anything involving arrays, symbolic algebra, or high precision. Wolfram Alpha will solve equations; this tool will not. Where the browser version wins is latency and availability: press "/" in your URL bar, compute, and close the tab, without installing anything or signing in. For quick arithmetic and trig with the occasional log and square root, it replaces the OS calculator one to one.
Frequently Asked Questions
Why does sin(pi) not return exactly zero?
Because <code>Math.PI</code> is the closest IEEE 754 binary64 approximation to the mathematical constant, not the constant itself. Its value differs from true π by about 1.2 * 10<sup>-16</sup>, and the sine near π has derivative close to -1, so the error propagates at roughly the same magnitude. Every engine that follows the floating-point standard - V8, SpiderMonkey, JavaScriptCore, the Python <code>math</code> module, C's libm - gives the same tiny non-zero answer.
Does 0.1 + 0.2 really equal 0.30000000000000004?
Yes, and it is a property of IEEE 754 binary floating point rather than a browser bug. Neither 0.1 nor 0.2 has an exact binary representation, so the rounded sum does not land on the nearest representation of 0.3. For financial work that must be cent-exact you need decimal arithmetic (<code>BigDecimal</code> in Java, <code>decimal.Decimal</code> in Python, or integer cents), not this calculator.
Is any of my input sent to a server?
No. The scientific calculator is a Preact island shipped as static JavaScript; the parser, tokenizer, and evaluator all execute inside your tab. You can verify in DevTools that pressing = produces zero network requests. The history strip lives in component state and is thrown away on page refresh or close.
Why can I type sin but not arcsin?
The current build exposes the forward trig functions (sin, cos, tan) and the logarithms (log, ln) to keep the keypad small. Inverse trig and hyperbolic functions are a reasonable feature request but are not wired in at the moment. As a workaround you can evaluate <code>asin</code> expressions elsewhere (Python or a CAS) and paste the number back.
What does the caret (^) do exactly?
It is the exponentiation operator with right-associative binding, so <code>2^3^2</code> means <code>2^(3^2)</code> = 2<sup>9</sup> = 512, matching the mathematical convention in ISO 80000-2. Internally it calls <code>Math.pow</code>. For non-integer exponents on negative bases the result is NaN because the true answer is complex.
How precise are the results?
Every operation runs in IEEE 754 binary64 (double precision), giving roughly 15 to 17 decimal digits of mantissa accuracy. That is enough for any scientific problem that would normally use a handheld calculator. For arbitrary-precision work you need a library like mpmath (Python), BigFloat (Julia), or Wolfram; for decimal-exact financial work you need a decimal type.
Can I chain the previous answer into the next calculation?
The history strip shows the last five (expression, answer) pairs. Clicking a past answer copies it into the current expression at the cursor position, so you can reuse it as a subterm. There is no dedicated Ans variable the way a TI-84 has, but the history click does the same job.
Why does the calculator use radians rather than letting me pick degrees?
Radians are the natural unit for derivatives and Taylor series, so <code>Math.sin</code> in every major engine takes radians. A degrees toggle would require a mode state that the rest of the UI would have to display to prevent the classic "I got the wrong answer because I forgot the mode" bug. Converting is a short prefix - <code>sin(x * π / 180)</code> - and the π key is one tap away.
What is the difference between log and ln here?
<code>log</code> means base-10 (common) logarithm, matching engineering and chemistry convention (pH, decibels), and maps to <code>Math.log10</code>. <code>ln</code> means natural logarithm with base e, mapping to <code>Math.log</code>. Pure mathematicians sometimes write <code>log</code> to mean natural log; the ISO 80000-2 standard recommends <code>lg</code> for base-10 and <code>ln</code> for base-e but allows <code>log</code> for base-10 when context is clear.
Will very large numbers overflow?
Yes, at roughly 1.8 * 10<sup>308</sup>, which is <code>Number.MAX_VALUE</code>. Anything larger renders as <code>Infinity</code>. Very small positive numbers below about 5 * 10<sup>-324</sup> underflow to 0. In between you have full double-precision range, which is more than a physical calculator normally provides.
More Math & Calculators
Age Calculator
Calculate exact age in years, months and days from a birthdate.
Open toolArea & Volume Calculator
Calculate area of 2D shapes and volume of 3D solids.
Open toolBMI Calculator
Calculate your Body Mass Index and find your weight category.
Open toolByte / Bit Converter
Convert between bits, bytes, KB, MB, GB, TB and PB.
Open toolDiscount Calculator
Calculate discount amount, sale price, savings, and discounted value with optional sales tax. Supports stacked coupons.
Open toolFibonacci Sequence Generator
Generate Fibonacci numbers up to any length.
Open tool