Tools › Units › Calculators › Formula with Units


Formula with Units

A unit-aware calculator: type variables with values in any mix of SI and US customary units (kN, lbf, slug, ft/s, deg …), a formula in plain syntax, and the tool evaluates it with the site's symbolic unit engine. Every variable is reduced to the seven SI base units (plus the radian), the formula is checked dimensionally (a force cannot be added to a length, the argument of a sine must be dimensionless), and the result is reconstructed into a derived unit, shown in SI with a sensible prefix, in US customary units, in any requested compatible unit and as its base-unit form. An optional Buckingham Π analysis gives the dimension matrix of the variable list, its rank, the number of independent dimensionless groups and the groups themselves.

  • Variables with values and units from both systems; blank unit = dimensionless

  • Formula in EvalMath syntax (+ − × / , sqrt, sin … atan, exp, ln, abs, min, max, constants π and e)

  • Dimensional consistency check with the offending sub-expression named

  • Result in SI (prefixed), US customary, a requested unit and base units kg·m·s⁻²

  • Buckingham Π: dimension matrix, rank, repeating variables and the Π groups with rational exponents

Formula with Units


Unit System: /

Variables (name, value, unit as spelled in the dictionary: kN, psi, slug, ft/s, deg …; blank = dimensionless)

1
2
3
4

Formula







×

Formula with Units

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.

typeSIUS customary
lengthmmil, in, ft, yd, sm (statute mile), nmi
aream^2in^2, ft^2, yd^2, smi^2
volumem^3, Lin^3, ft^3, yd^3, sm^3
second moment of aream^4in^4, ft^4
warping constantm^6in^6, ft^6
velocitym/sft/s, ft/min, mph, kts
accelerationm/s^2ft/s^2, g
masskglbm, slug
forceNlb (= lbf), kip
moment, energyN-m (J accepted)lb-in, lb-ft (ft-lbf, in-lbf accepted)
powerWhp, ft-lb/s, Btu/h, ton (refrigeration)
pressure, stressPaPSI, KSI, MSI, GSI, inH2O
densitykg/m^3, kg/LPCF, PCI, lb/ft^3, lb/in^3 (pound-mass)
line loadN/mlb/in, lb/ft
compliancem/Nin/lb
volume flowm^3/s, L/s, m^3/hcfm, ft^3/s, gpm
mass flowkg/s, kg/h, kg/minlb/h, lb/min, lb/s
specific heatJ/(kg-K), kJ/(kg-K)(Btu/(lb-F) is refused: F is an offset scale)
thermal conductanceW/K, kW/K(Btu/(h-F) likewise)
angular velocityrpm, rad/srpm, rad/s
areal densitykg/m^2lb/ft^2
moment per widthN-m/mlb-in/in
temperature, differenceK; °C (difference)R; °F (difference)
thermal expansionµm/m/°Cµin/in/°F
angleraddeg, grad
supplied by the tools, 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.




References

Buckingham, E. (1914). "On Physically Similar Systems; Illustrations of the Use of Dimensional Equations." Physical Review, Vol. 4, No. 4, pp. 345–376.

Bridgman, P. W. (1922). Dimensional Analysis. Yale University Press, New Haven, CT.

Thompson, A., and Taylor, B. N. (2008). Guide for the Use of the International System of Units (SI). NIST Special Publication 811, National Institute of Standards and Technology, Gaithersburg, MD.

Bureau International des Poids et Mesures (2019). The International System of Units (SI), 9th ed. BIPM, Sèvres.

Sonin, A. A. (2001). The Physical Basis of Dimensional Analysis, 2nd ed. Massachusetts Institute of Technology, Cambridge, MA.


DISCLAIMER: The methods and calculation on aNOWysis.com are provided as means to educate the reader. There is no warranty, expessed or implied, as to the relevance or accuracy of the methods or calculations. All calculations should be checked by a qualified analyst for appropriateness and accuracy. We will not be held liable for any damages, injuries or deaths caused by using methods or calculations from this site.