CSS Units Converter
Convert between px, rem, em, vw/vh/vmin/vmax, %, ch/ex, and print units using real context values. See a multi-unit table instantly.
Tip: Set % context and DPI for print units; ch/ex are font-dependent approximations.
Result
16 px = 1 rem
Root: 16px · Element: 16px · % context: 100px · DPI: 96
Viewport: 1440px × 900px · ch: 0.5em · ex: 0.5em
Reverse: 1 rem = 16 px
Multi-output
Design tokens mode
Paste tokens and convert to rem or Tailwind-style spacing.
Paste tokens to see converted output.
Clamp helper
Generate a responsive clamp() expression quickly.
clamp(16px, 24px, 40px)
How to use
- Enter a value and choose from/to units.
- Set root font size for rem and element font size for em; adjust viewport and context inputs.
- Review the multi-output table for key units at once.
Examples
- 16px → 1rem (root font 16px)
- 24px → 1.5rem (root font 16px)
- 8px → 0.5rem (root font 16px)
FAQ & privacy
Does this run locally? Yes. All calculations happen in your browser.
Which units are supported? px, rem, em, vw, vh, vmin, vmax, %, ch, ex, pt, pc, in, cm, mm.
What’s the difference between rem and em? rem uses the root font size; em uses the element font size.
How should I set % context? Use the size the percentage is based on (container width/height).
Are ch/ex exact? They are font-dependent; adjust ratios for your font.
How do vw/vh work? Values are based on the viewport width/height you set (default 1440×900).
Why no fr? Grid fractions need layout context, so they belong in a dedicated grid tool.