\usepackage{siunitx}. In siunitx version 3, use \num{...} for numbers, \qty{value}{unit} for quantities, \unit{...} for standalone units, \qtyrange{a}{b}{unit} for ranges, and \ang{...} for angles.
For discipline-specific notation beyond numbers and units, see Physics notation and Chemistry notation. For LaTeX page-layout dimensions (pt, cm, em), see LaTeX lengths and units.
Numbers, quantities, and units (siunitx v3)
siunitx handles non-breaking thin spaces between values and units, upright unit fonts even inside italic text or math mode, and consistent multiplication signs in scientific notation (6.022e23). Both US and international spellings work (\meter or \metre, \liter or \litre).
siunitx-basics.tex
Ready to use this syntax? Continue in the browser editor when you want to adapt the example in a real project.Open LaTeX Cloud Studio
The version 2 names (
\SI, \si, \SIrange) still work as compatibility aliases in siunitx 3, but new documents should use \qty, \unit, and \qtyrange.
Compound units and custom units
By default,siunitx formats \per using negative powers (per-mode=power). Pass per-mode=symbol for a slash (m/s^2), per-mode=fraction for a stacked fraction, or set inline-per-mode=symbol and display-per-mode=fraction to use a slash inline and a fraction in display math. Options can be set per command (\qty[...]{...}{...}) or document-wide with \sisetup{...} in the preamble.
For domain units not built into siunitx (such as ppm or molarity M), declare them in the preamble with \DeclareSIUnit:
si-units.tex
Measurement uncertainties
siunitx parses uncertainties written either in concise parentheses (2.45(5)) or with +- (2.45 +- 0.05). By default (uncertainty-mode=compact), both render in parenthesized form. Set uncertainty-mode=separate to display ±, and choose separate-uncertainty-units=bracket (default), single, or repeat to control how the unit attaches.
error-analysis.tex
Aligning numbers in scientific tables (S columns)
siunitx defines the S column type for tabular environments, aligning numbers on the decimal marker while formatting exponents and uncertainties automatically. Specify the column width with table-format (for example table-format=1.2(1) for one integer digit, two decimals, and a one-digit uncertainty, or 1.2e-1 for signed exponents), and wrap non-numeric headers in {...} so siunitx does not try to parse them as numbers.
data-presentation.tex
Common mistakes
- Using undeclared unit macros: Macros such as
\ppmor\Molarare not predefined insiunitx3 and fail to compile unless you declare them with\DeclareSIUnitin the preamble. - Forgetting braces around headers in
Scolumns: A heading such asMass (\unit{\gram})in anScolumn stops withInvalid number '('unless wrapped in braces:{Mass (\unit{\gram})}. - Typing units in math mode without
\unitor\qty: Writing$9.81 m/s^2$setsmandsas italicized variables with incorrect spacing. Use\qty{9.81}{\meter\per\second\squared}instead. - Setting
per-modeoruncertainty-moderepeatedly on every call: Put shared formatting preferences once in\sisetup{per-mode=symbol, uncertainty-mode=separate}in the preamble.
Try it in the editor
LaTeX Cloud Studio compiles with TeX Live 2026 (full distribution), which includessiunitx 3.5.5 and booktabs. Start from the Lab Report template in LaTeX Cloud Studio and replace main.tex with any of the complete examples above.
