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 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.

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):
- Syntax. Quantities are written as meters, 60mi / 1hr, sqrt(area); operations are performed
- on the quantity types.
- Batteries included. Over 280 units across 48 dimensions ship ready to use — SI, imperial and
- US-customary, ancient, and esoteric alike (3.0cwt, 10.0fur, 1.0rem), each a named type with a literal and an exact, canonically-sourced conversion ratio. There is no unit "system" to select or instantiate: every unit is…
- compiles to no machine code. A quantity is a trivially-copyable value the size of its underlying type.
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
More projects to explore
awesome-selfhosted
awesome-selfhosted/awesome-selfhosted
A list of Free Software network services and web applications which can be hosted on your own servers
awesome-go
avelino/awesome-go
A curated list of awesome Go frameworks, libraries and software
NextChat
ChatGPTNextWeb/NextChat
✨ Zero-config AI chat assistant. No API key needed — sign up and instantly chat with GPT-5, Claude 4, Gemini 2.5, DeepSeek & 100+ top models. Pay-as-you-go saves you more. Available on Web, iOS, macOS, Android, Linux, Windows.
vue-element-admin
PanJiaChen/vue-element-admin
A magical vue admin https://panjiachen.github.io/vue-element-admin