How to use the CSS Units Converter
- Enter a value and its unit.
- Set your root font size, parent size and viewport if they differ from the defaults.
- Copy the value in any other unit.
What does this tool do?
Using rem for type and spacing respects users' browser font settings, which is better for accessibility than fixed pixels. The default root size is 16px, so 24px = 1.5rem. Physical units like cm and pt use CSS's fixed 96 pixels per inch, so they are only accurate in print.
Why use it?
- All 12 units at once.
- Custom base sizes.
- clamp() idea included.
Use cases
- Convert a design's pixel values to rem.
- Work out viewport units for full-screen layouts.
- Set print styles in pt or cm.
With a 16 px root and a 1440 px wide viewport
Common conversions:
| Value | Equals |
|---|---|
| 24px | 1.5rem |
| 12pt | 16px |
| 1in | 96px |
| 1cm | ≈ 37.8px |
| 50vw | 720px |
Common mistakes
- Using em for spacing deep in nested elements, where sizes compound.
- Assuming 1cm on screen is a real centimetre.
- Hard-coding px font sizes, which ignore users' settings.
Privacy
The calculation happens instantly in your browser. The numbers you enter are not sent to our servers or saved. There's no account to create and nothing to install.
Frequently asked questions
rem or em?
rem is relative to the root font size, so it's predictable. em is relative to the parent's font size.
Why does 100vh cause scroll on phones?
Mobile browser toolbars change the visible height; dvh or svh units handle this.
Is 1rem always 16px?
Only by default. Users and stylesheets can change the root size.
Content last updated . See how M2Toolkit works.