Calcolatore di Formule
Calcolatore di formule multiriga con variabili, prefissi SI e moltiplicazione implicita
What is the Formula Calculator?
The Formula Calculator is an online calculation tool that supports multi-line variable definitions, real-time evaluation, and automatic dependency propagation. You write calculation logic line by line like code — each line defines a variable or evaluates an expression, with results displayed immediately in the right panel. It runs entirely in the browser with no server required, making it ideal for engineers, students, and developers.
How to Use
Type formulas line by line in the editor. Use name = expression syntax to define variables that subsequent lines can reference. Pure expressions (without =) are evaluated directly. Lines starting with // are comments. All formulas auto-save to IndexedDB.
Example: a = 10 b = a * 3 sqrt(b) Result: a = 10, b = 30, last line shows 5.477...
SI Prefixes and Implicit Multiplication
Supported SI prefixes: T (10^12), G (10^9), M (10^6), k (10^3), m (10^-3), u (10^-6), n (10^-9), p (10^-12). For example, 10k = 10000, 4.7u = 0.0000047. A number directly followed by a variable name auto-inserts multiplication: 2PI = 2*PI, 3R1 = 3*R1.
Built-in Functions and Constants
Built-in functions: sin, cos, tan, asin, acos, atan, atan2, sinh, cosh, tanh, sqrt, cbrt, exp, log, log2, log10, abs, ceil, floor, round, pow, max, min, sign, trunc.
Constants: PI, E, LN2, LN10, LOG2E, LOG10E, SQRT2, SQRT1_2, Infinity.
Number Formats and Operators
Multiple number formats are supported in expressions: - Hexadecimal: 0xFF (equals 255) - Binary: 0b1010 (equals 10) - Octal: 0o77 (equals 63) - Percentage: 50% (equals 0.5)
Special operators: - Power: a ^ b computes a raised to the power of b - Conditional: condition ? valueIfTrue : valueIfFalse - Comparison and logical operators: >, <, >=, <=, ==, !=, &&, ||, !
User-Defined Functions and Angle Mode
Define custom functions using arrow syntax: f = x => x^2 f(3) // → 9
g = (a, b) => sqrt(a^2 + b^2) g(3, 4) // → 5
User functions can reference previously defined variables and are called like built-in functions.
Angle Mode: Click the DEG/RAD button to switch between degree and radian mode for trigonometric functions. In DEG mode, sin(90) = 1; in RAD mode, sin(PI/2) = 1.