Skip to content
r.

units

nholthaus/units · Public GitHub repository

a compile-time, header-only, dimensional analysis and unit conversion library built on c++14 with no dependencies.

Open project in RepoShelf

Open the project to try its demo, view the repository, or save it to your collection. Repository and demo actions use RepoShelf’s sign-in flow.

units live demo screenshot
Captured from the live demo · 2026-10-31

About this project

Author-written excerpt from the project README.

A compile-time, header-only, dimensional-analysis and unit-conversion library for C++23, with no dependencies.

units represents physical quantities as types. A quantity is a value with a unit — meters, feet, seconds — that behaves like the number it wraps. Conversions between compatible units are implicit and resolved at compile time; expressions that are dimensionally inconsistent do not compile.

Quantities are written with unit literals (5.0m) or by multiplying a value by a unit constant (60.0 km):

Requirements and intended audience

A compile-time, header-only, dimensional-analysis and unit-conversion library for C++23, with no dependencies.

Not recorded: account, external api key, paid service, self-hosting. Missing information does not mean there are no requirements.

Statements extracted from the author’s documentation · Checked 2026-10-24. Source: https://github.com/nholthaus/units/blob/main/README.md

Recorded maintenance information

Last recorded source update: 2026-10-18. Saved release: v3.6.1 · 2026-08-18. These dates do not guarantee ongoing maintenance.

Technologies
C++
Licence
MIT. Generally permits modification and commercial use, subject to the licence’s notices and conditions.
Demo check
A public page loaded on 2026-11-20. This does not test every feature.

Browse related categories