Convert Units With units

Translate between length, mass, temperature and many other units.

macOSTerminalscriptingLow risk
Run units "10 miles" "km" to print the converted value.

01Command

Command
$ units "10 miles" "km"

02What it does

units understands a large database of physical units and currencies-like ratios, and accepts compound expressions such as 60 mph or m/s^2. Run it with no arguments for interactive mode, or pass both quantities to convert in one shot.

03Risk

RiskLow risk
CompatibilitymacOS (built-in)
!Warning: Unit names are case-sensitive and ambiguous abbreviations can be misread; quote the arguments to keep the shell from splitting them.

04Undo

✓No undo needed — this command does not change persistent state.

05Sources

  • GNU Units
    GNU · technical · 2026-09-20
    Evidence: GNU Units converts between thousands of units; the macOS units is a compatible implementation.

Last verified: 2026-09-20 · Category: Developer

06Related solutions