Tools › Units › Calculators › Formula with Units › Method
Formula with Units: Method
Open the Formula with Units tool
Formula with Units
What the tool does
The tool takes a list of variables, each with a value and a unit spelled as the site's dictionary spells it, and a formula written in the variable names. It reduces every variable to the SI base units, evaluates the formula on those values, carries the units through every operation symbolically, checks that the operations are dimensionally admissible, and gives the result back in a derived unit: in SI with a prefix that keeps the number between 1 and 1,000, in US customary units, in any unit you ask for that has the same dimensions, and as its base-unit form. It is the same unit engine that runs behind every analysis tool on the site, made visible. A second function, independent of the formula, is a Buckingham Pi analysis of the variable list.
Base units
Every unit in the dictionary is defined by its composition in the seven SI base units: the metre (length), kilogram (mass), second (time), ampere (current), kelvin (temperature), mole (amount of substance) and candela (luminous intensity), together with a factor. A newton is kg·m·s⁻² with the factor 1; a pound-force is the same composition with the factor 4.448 221 615 N; a pound per square inch is kg·m⁻¹·s⁻² with the factor 6,894.757 Pa. A unit is therefore a vector of eight exponents (the radian, dimensionless in the SI, is tracked as an eighth entry so that an angle survives conversion instead of collapsing to a pure number) and one number. Reducing 1,000 lbf to base units means multiplying by 4.448 and keeping the vector (0, 1, −2 on m, kg, s); reducing 0.5 in means multiplying by 0.0254 and keeping (1, 0, 0). Conversion factors follow the BIPM SI Brochure (2019) and NIST Special Publication 811 (2008): the inch, foot, pound-mass and pound-force are exact (0.0254 m, 0.3048 m, 0.453 592 37 kg, 0.453 592 37 × 9.806 65 N).
How units move through a formula
Multiplication adds the exponent vectors, division subtracts them, a power multiplies them by the exponent, a square root halves them. These four rules carry the units of any product of powers. Addition and subtraction add nothing to the vector but impose a condition: the two terms must have the same vector, or the sum has no meaning. A force cannot be added to a length, and a stress in ksi cannot be added to a stress in MPa until one is converted, which the reduction to base units does automatically. The arguments of the transcendental functions (sine, cosine, tangent, exponential, logarithm) must be pure numbers, because ex = 1 + x + x²/2 + … adds powers of x together, which is only admissible when x is dimensionless; an angle is admitted, the radian being the ratio of two lengths. An exponent must likewise be a pure number: (F/A)n is fine when n is a plain number, FL is not. The inverse trigonometric functions return an angle in radians, which the tool tags so that it can be shown in degrees.
The tool parses the formula into a tree and applies these rules node by node; when a rule is violated it names the two sub-expressions that clash and their units, and the arithmetic result is still printed, labelled as meaningless. The numerical evaluation uses the site's EvalMath class on the SI values; the result's exponent vector is matched against the dictionary to find a derived name (kg·m⁻¹·s⁻² is a pascal, kg·m²·s⁻³ a watt). A vector with no dictionary name is printed in base units. A result that carries the radian with other units (an angular velocity in rad/s times a radius) is also read with the radian dropped, since that is how the SI treats it.
Syntax
Operators + − * / ^ with the usual precedence and parentheses; the functions sqrt, abs, sin, cos, tan, asin, acos, atan, sinh, cosh, tanh, exp, ln, log (also the natural logarithm; write ln(x)/ln(10) for base 10), floor, ceil, round, min, max; the constants pi and e. Variable names start with a letter and continue with letters, digits and underscores; they are case-insensitive (F and f are the same variable), and a variable named e or pi replaces the constant. Greek names (sigma, tau, theta, omega, rho, mu …) are printed as Greek letters in the results and an underscore makes a subscript, so sigma_y is shown as σy. Numbers may be written 1.5e-3. A blank unit means a pure number.
Unit spellings accepted
The table lists the dictionary spellings by type (SI, then US customary), as of 2026-11-07. Any SI spelling may take an SI prefix (kN, MPa, GPa, mm, μm, kJ), and any spellings may be combined with *, / and ^ and parentheses (Pa*s, N/m^2, kg/(m*s), lbf/in^2, slug/ft^3, km/h); a product may also be written with a hyphen or a middle dot (N-m, N·m). Note the dictionary's conventions: lb is the pound-force (lbf is accepted as an alias) and lbm the pound-mass; ksi, psi and Msi may be typed in lower case; g is the standard acceleration of gravity, 9.80665 m/s², not the gram (grams are not a dictionary unit, use kg or mg of mass through the kilogram only); lb/ft^3 and lb/in^3 are densities in pound-mass per cubic foot or inch. Temperatures on the Celsius, Fahrenheit and Réaumur scales have an offset that a multiplicative conversion cannot carry and are refused; use K or R for absolute temperatures and °C or °F for temperature differences.
| type | SI | US customary |
|---|---|---|
| length | m | mil, in, ft, yd, sm (statute mile), nmi |
| area | m^2 | in^2, ft^2, yd^2, smi^2 |
| volume | m^3, L | in^3, ft^3, yd^3, sm^3 |
| second moment of area | m^4 | in^4, ft^4 |
| warping constant | m^6 | in^6, ft^6 |
| velocity | m/s | ft/s, ft/min, mph, kts |
| acceleration | m/s^2 | ft/s^2, g |
| mass | kg | lbm, slug |
| force | N | lb (= lbf), kip |
| moment, energy | N-m (J accepted) | lb-in, lb-ft (ft-lbf, in-lbf accepted) |
| power | W | hp, ft-lb/s, Btu/h, ton (refrigeration) |
| pressure, stress | Pa | PSI, KSI, MSI, GSI, inH2O |
| density | kg/m^3, kg/L | PCF, PCI, lb/ft^3, lb/in^3 (pound-mass) |
| line load | N/m | lb/in, lb/ft |
| compliance | m/N | in/lb |
| volume flow | m^3/s, L/s, m^3/h | cfm, ft^3/s, gpm |
| mass flow | kg/s, kg/h, kg/min | lb/h, lb/min, lb/s |
| specific heat | J/(kg-K), kJ/(kg-K) | (Btu/(lb-F) is refused: F is an offset scale) |
| thermal conductance | W/K, kW/K | (Btu/(h-F) likewise) |
| angular velocity | rpm, rad/s | rpm, rad/s |
| areal density | kg/m^2 | lb/ft^2 |
| moment per width | N-m/m | lb-in/in |
| temperature, difference | K; °C (difference) | R; °F (difference) |
| thermal expansion | µm/m/°C | µin/in/°F |
| angle | rad | deg, grad |
| supplied by the tool | s, min, h (hr), day, J, Hz, A, V, ohm, mol, cd, rev, kgf, cal; Btu (International Table, 1,055.056 J). The SI ones take prefixes (ms, kJ, MJ, kHz, mA). | |
Buckingham's Pi theorem
If a physical relation holds among n variables whose dimensions span r independent base dimensions, it can be written as a relation among k = n − r dimensionless products of powers of the variables (Buckingham 1914; the rigorous statement is Bridgman's, 1922, and Sonin's, 2001). The tool writes the dimension matrix, one row per variable and one column per base dimension present (mass M, length L, time T, temperature Θ, current I, amount N, luminous intensity J; the radian is dropped here, as the theorem requires), finds its rank r by Gaussian elimination in exact rational arithmetic, and takes as repeating variables the last r variables of the list that are dimensionally independent. Each of the remaining k variables then forms one group: that variable to the first power times the repeating variables to the powers that cancel its dimensions, found from the reduced matrix. The exponents are rational; the tool prints them as fractions and, scaled by their common denominator, as integers. Because the repeating variables are taken from the end of the list, put the quantity you want to solve for first and the variables that should appear in every group (a density, a velocity, a length) last.
Pendulum. Period T, length L, gravity g: dimensions T → T, L → L, g → L T⁻². The matrix has rank 2, so k = 1. Repeating variables L and g; the group is T·La·gb with L: a + b = 0 and T: 1 − 2b = 0, giving b = ½, a = −½, Π = T√(g/L), or T²g/L in integers. The theorem says T√(g/L) is a constant, which the full solution gives as 2π for small swings; dimensional analysis alone fixes the dependence T ∝ √(L/g) without solving anything.
Drag. Drag force F, viscosity μ, density ρ, velocity v, diameter D: rank 3, k = 2. With ρ, v, D repeating, Π1 = F/(ρv²D²) and Π2 = μ/(ρvD) = 1/Re. Hence F/(ρv²D²) = f(Re): the drag coefficient is a function of the Reynolds number only, which is the content of every drag chart. Listed in the order F, ρ, v, D, μ the tool takes v, D, μ as repeating and gives the equivalent pair F/(μvD) and ρvD/μ; their quotient is the drag coefficient. Any set of k independent products is as good as any other.
Pump. Shaft power P, density ρ, speed N (rpm), impeller diameter D: rank 3, k = 1, Π = P/(ρN³D⁵), the power coefficient of the affinity laws; the revolution per minute enters through its time dimension only.
Limits
The evaluator handles arithmetic and the listed functions; comparison and logical operators are not accepted. A unit is matched to a derived name only when its exponent vector equals a dictionary composition exactly, so unusual combinations (N·s, kg^½) are printed in base units. The US customary display uses the dictionary's units of the result's type chosen by magnitude, and base units composed from ft, lbm, s, R and deg when the type has none. The Pi analysis gives one valid set of groups; products and powers of them are equally valid, and it cannot tell which variables matter physically, only how the ones you list combine.