CT Calc Tools

Scientific Calculator

Evaluate arithmetic, powers, roots, trig, logarithms and constants with a safe client-side parser.

🔒 Runs entirely in your browser — nothing is uploaded

Result

12.25

Parsed locally without eval.

Advertisement

Safe scientific calculator parser

This calculator supports everyday scientific expressions without using JavaScript eval. The parser first tokenizes numbers, operators, parentheses, constants and function names. It then applies arithmetic precedence: parentheses first, functions and unary signs, powers, multiply and divide, then addition and subtraction. The core formula rules are the familiar ones: a + b, a − b, a × b, a ÷ b and a^b. Percent is a postfix shortcut that converts the preceding value to a fraction by dividing it by 100.

Functions include square root, sine, cosine, tangent, base-10 logarithm and natural logarithm. Trigonometric functions use degrees, so sin(30) returns 0.5. Constants can be entered as π, pi or e. Invalid expressions, division by zero, logarithms of non-positive values and square roots of negative values show an error instead of producing an unsafe or misleading result.

Examples and supported syntax

Try expressions such as sqrt(144), 2^8, sin(45)^2 + cos(45)^2, log(1000) or 50% * 200. Multiplication must be typed explicitly, so write 2*pi instead of 2pi. Parentheses can be nested to group parts of a longer calculation. The buttons insert plain text into the expression field, and you can also type directly with a keyboard.

Privacy and accuracy notes

All calculation happens in the browser using standard JavaScript numbers. That is appropriate for general math, school checks and quick engineering estimates, but not arbitrary-precision finance or symbolic algebra. The page does not upload expressions, does not store history and does not call a math API. Check important results, especially where rounding, angle units or domain restrictions matter.

For long expressions, build the calculation in smaller parts and use parentheses to make your intent explicit. That reduces mistakes and makes the displayed expression easier to audit before you rely on the result.

How to use

  1. Type or tap an expressionUse numbers, operators, parentheses, constants and functions such as sqrt, sin, cos, tan, log and ln.
  2. Evaluate safelyPress equals to run the built-in parser. The page never uses eval.
  3. Check the resultRead the result and the normalized expression line for quick verification.

Frequently asked questions

Does this calculator use eval?
No. It tokenizes the expression and evaluates it with a small safe parser written in client-side TypeScript.
Are trig functions in degrees or radians?
Sin, cos and tan use degrees because that is friendlier for everyday calculator use.
What does the percent key mean?
Percent is treated as a postfix operator that divides the preceding value by 100.
Can expressions leave my browser?
No. Everything is calculated locally and no expression history is uploaded.
Advertisement