What it does
The UDUNITS-2 program converts numeric values between compatible units and displays unit definitions. It offers interactive prompts, command-line arguments, character-set choices, and an XML unit database.
Enter a quantity and desired compatible unit interactively, or pass them with -H and -W. UDUNITS-2 prints the converted value and transformation; an empty destination instead expands the source into the imported system's base units. An XML database supplies definitions, with ASCII, Latin-1 or UTF-8 formatting options. The -r flag reveals database import problems that are otherwise suppressed by the CLI. C APIs manipulate units and convert values, but units must belong to the same unit-system. Time handling uses a fixed Gregorian/Julian calendar split at 1582-10-15; the guide recommends a dedicated calendar package for calendar calculations. The source licence permits redistribution and modification subject to its conditions.
Strengths
- Combines interactive conversions with inspectable definitions and a configurable unit database.
Best for
- Scientific and technical unit conversion in scripts or terminals
Sources
- UDUNITS 2.2.28 Program Guide (Oct 26, 2026)
- UDUNITS2.2.28 C API Guide (Oct 26, 2026)
- UDUNITS-2 COPYRIGHT - Unidata (Oct 26, 2026)
- UDUNITS2.2.28 C API Guide - Time Handling (Oct 26, 2026)