UnitProof Unit Calculator

Unit maths you can audit: dimension check, exact factors and a full derivation tree.

Numbers, units with SI prefixes, ^ powers, * / + − and parentheses; optional "to"/"in" target. Juxtaposition (e.g. "2 h") binds tighter than * and /. Bare C/F mean °C/°F.

Try an example: · · · · ·

More about this tool

Part of RavingDesk Developer & data tools

How it works

Type an expression such as "3.5 km/h * 2 h to m", "72 F to C" or "1500 W * 3 h to kWh". UnitProof parses it, checks dimensions over the SI base units, applies exact NIST/SI conversion factors and shows every step as a derivation tree, including correct absolute-vs-difference temperature handling.

  • A tokenizer and recursive-descent parser read numbers (incl. scientific notation), units with SI prefixes (q…Q, incl. µ/u) and binary prefixes (Ki…Ei for bit/B), ^ powers (also ² ³ and "m2"), × ÷ + − and parentheses. Juxtaposition ("2 h", "kg m") binds tighter than explicit * and /, so "60 km / 2 h" = 30 km/h.
  • Every quantity is a value in coherent SI units plus a dimension vector over m, kg, s, A, K, mol, cd and bit; ISO 4217 currency codes are carried as opaque dimensions (never converted). The table has 144 named units.
  • Multiplication adds dimension exponents, division subtracts them, powers scale them; addition, subtraction and conversion require identical dimensions, otherwise the calculation stops with an explanation of the mismatch.
  • Temperatures: "72 F" or "-40 C" (a number directly followed by °C/°F) is an absolute temperature converted with its offset; absolute − absolute gives a difference; absolute ± difference stays absolute; multiplying, dividing or powering °C/°F is refused as ambiguous (use K or deltaC/deltaF). Converting a difference to °C/°F applies only the scale factor.
  • Exact factors follow the SI Brochure (9th ed.) and NIST SP 811 Appendix B (international foot/pound, US liquid gallon = 231 in³, Btu_IT, thermochemical calorie, etc.); conventional or measured values (mmHg, inHg, dalton) are flagged as not exact.
  • The derivation graph lists literals, unit definitions (with factor), operations and the final conversion; values are IEEE-754 doubles, shown unrounded and rounded to the requested significant digits.

Sources

Use this tool in an app

These free programs for your browser have this tool built in, next to everything else the task needs.

  • RavingDesk Paper trading & data workspace

    Practise trading on paper and chart your data: orders, risk, datasets, analyses, reports.

    Open RavingDesk

  • Sizewise Scale & big-number visualiser

    Make sizes, amounts and big numbers feel real: to-scale lineups, fit counts and stacks.

    Open Sizewise

How to use UnitProof

Calculate with units like "1500 W * 3 h to kWh", check dimensions, convert with exact SI and NIST factors and handle °C/°F temperatures correctly.

What it is for

Most unit converters handle one conversion at a time. Real questions mix units: how far do I get at 3.5 km/h in 2 hours, how many kWh does a 1500 W heater use in 3 hours, what force does 75 kg exert under gravity? UnitProof lets you type the whole calculation as one expression, such as 1500 W * 3 h to kWh. It parses the expression, checks that the dimensions make sense, applies exact conversion factors from the SI Brochure and NIST SP 811, and shows every step as a derivation tree.

It's strict where strictness saves you from mistakes. Adding metres to seconds is refused with an explanation. Multiplying a temperature in °C is refused as ambiguous. A temperature difference is converted without the zero-point offset. Currency codes like USD can be carried through a calculation but are never converted, because there are no exchange rates. Values are ordinary floating-point numbers, shown both unrounded and rounded.

Worked example

Worked example
ExpressionResult
3.5 km/h * 2 h to m7,000 m (length)
1500 W * 3 h to kWh4.5 kWh (energy; 16,200,000 J in SI)
9.81 m/s^2 * 75 kg to N735.75 N (force)
1 mi + 200 m to km (4 significant digits)1.809 km (exactly 1.809344)
72 F to C22.2222 °C
5 USD/kg * 2.5 kg12.5 USD

The derivation for 72 F to C shows the absolute conversion: (72 + 459.67) × 5/9 = 295.372 K, then K → °C. Compare 30 C - 20 C to F: two absolute temperatures subtracted give a difference, so the result is 18 Δ°F, not 50 °F. A warning explains that the zero-point offset wasn't applied.

Two inputs that are refused, on purpose:

  • 1 m + 1 s → Cannot add quantities with different dimensions: L — length + T — time.
  • 20 C * 2 → Refusing to multiply or divide an absolute temperature… Convert to K first, or use deltaC/deltaF.

How to read the result

  • value / valueRounded: the exact floating-point result and the result rounded to your significant digits (default 6).
  • unit / target: the unit of the answer. Without a to … target, you get coherent SI units: 60 km / 2 h returns 8.33333 m/s.
  • dimension and quantity: the dimension vector (for example L^2·M·T^-2) and its name (energy). This is a useful sanity check.
  • temperature: absolute, interval or none. It tells you how temperatures were treated.
  • derivation: every literal, unit definition with its factor, operation and conversion, in order. You can audit exactly where a number came from.

Tips and common mistakes

  • Juxtaposition binds tighter than /: 60 km / 2 h means 60 km ÷ (2 h). Add to km/h to get 30 km/h instead of m/s.
  • Use deltaC and deltaF for temperature changes. "The room warmed by 10 deltaC" converts to 18 deltaF, while 10 C to F gives 50 °F.
  • Binary and decimal prefixes are different units: 1 GiB to MB = 1,073.74 MB. Use Ki/Mi/Gi only with bit or B.
  • Some units are conventional, not exact (mmHg, inHg, dalton). The derivation flags them, so don't expect infinite precision there.
  • Currencies are opaque: EUR + USD is refused, just like metres plus seconds.

FAQ

Why does 72 F to C show 22.222222222222285 unrounded?

That's ordinary floating-point arithmetic, which can't represent 5/9 exactly. The rounded value (22.2222 °C at 6 significant digits) is the one to use.

Which mile, gallon and calorie does UnitProof use?

It uses NIST SP 811 definitions: the international mile (1,609.344 m), the US liquid gallon (231 in³), the IT British thermal unit and the thermochemical calorie. The derivation shows each factor.

Can it convert currencies?

No. Currency codes are carried as their own dimension so that price calculations like 5 USD/kg * 2.5 kg work, but no exchange rate is ever applied.

Guide last updated:

For scripts and AI agents

  • JSON API: POST https://unitproof.usefulweb.site/api/v1/calculate (same calculation as this page)
  • Interface description: OpenAPI 3.1 · AI guide: llms.txt
  • MCP server (Streamable HTTP): https://unitproof.usefulweb.site/mcp · tool name unitproof
Example request
curl -s -X POST https://unitproof.usefulweb.site/api/v1/calculate \
  -H 'content-type: application/json' \
  -d '{"expression":"3.5 km/h * 2 h to m"}'
Feedback · ideas & bug reports welcome