📏 CSS Unit Converter
Convert between px, rem, em, pt, pc, in, cm, and mm with a custom root font size. All conversions update live.
Last updated: November 8, 2026 · By the BoltQuickTools team
All units from your "From" value
Turning a design measurement into a CSS value
A mockup says 14px and your codebase uses rem, or a print spec gives millimetres and you need pixels for a canvas. This page converts between eight CSS length units using the ratios the CSS specification fixes.
Converting a value
- Enter a number in From and pick its unit.
- Pick a unit in To. You can also type in the To box to convert in the other direction.
- Set Root font size if your project's
htmlfont size is not 16px. Press Enter or click away to apply it. - Read every unit at once in the grid below, and click a cell to make it the new From value. The arrow button swaps From and To.
Examples
| From | Root | Grid shows |
|---|---|---|
| 14 px | 16 | rem 0.875, em 0.875, pt 10.5, pc 0.875, in 0.145833, cm 0.370417, mm 3.704167 |
| 24 px | 10 | rem 2.4, em 2.4, pt 18, pc 1.5, in 0.25, cm 0.635, mm 6.35 |
| 1 in | 16 | px 96, rem 6, em 6, pt 72, pc 6, cm 2.54, mm 25.4 |
| 210 mm | 16 | px 793.700787, rem 49.606299, em 49.606299, pt 595.275591, pc 49.606299, in 8.267717, cm 21 |
The second row is the common html { font-size: 62.5%; } setup, where 1rem equals 10px. The last row is the width of an A4 page in CSS pixels, which is handy for print stylesheets.
What the converter does not account for
- em is treated as rem. Both use the Root font size, since a standalone value has no parent element. To work out an
eminside a 20px parent, set the root to 20, then set it back. - Only absolute and root-based units are listed. There is no %, vw, vh, ch or ex, because those depend on a container, viewport or font that the page cannot know.
- Physical units are nominal. 1cm in CSS is defined as 96/2.54 px. It will not measure one centimetre with a ruler on most screens, so
cmandinare mainly useful for print. - A blank or zero root falls back to 16. A non-numeric From value counts as 0.
- Results are rounded to six decimals. Values under 0.001 or from 1,000,000 up switch to exponent form with four decimals, for example
1.0417e-6.
Swap rounding and the 10px root
Why does swapping give me 1.000032 instead of 1?
Swap converts from the rounded number in the box. 1px is shown as 0.010417in, and swapping converts that back, giving 1.000032px. For an exact reverse, retype the original value rather than swapping.
Should I use the 10px root trick?
It makes the arithmetic simple, but setting a percentage on html means all your rem values depend on it, and a rem-based third-party component written for a 16px root will come out smaller. The CSS units reference covers how each unit resolves.
Can I convert a whole stylesheet?
No, it handles one value at a time. For layouts where the unit choice matters, the layout generator lets you try track and gap sizes, and the CSS layouts article discusses when fixed and flexible sizes each make sense.