Website & design
Free CSS unit converter
Convert px, rem, em, percentages, viewport units, and absolute lengths. Supply the relevant font size, viewport dimensions, or percentage basis so relative units match your layout.
- 14 CSS length units
- Context shown plainly
- No signup or uploads
Set the measurement
Convert a CSS length.
Runs entirely in your browser. No values are sent or stored.
Read the equivalent
Converted value
Result: 1.5rem.
24px equals 1.5rem for the context shown.
What this result used
- Root font
- 16 CSS px
Intermediate value: 24 CSS px
A property’s allowed range, browser rounding, and layout can still affect the used value. A CSS pixel is a reference pixel, not necessarily one physical device pixel.
How conversion works
Relative units need a real reference.
Relative CSS units do not have one universal pixel value. Results use the font, percentage basis, and viewport dimensions entered in the converter. Every conversion passes through a CSS-pixel equivalent without executing pasted CSS or guessing the property you meant.
| Unit family | What it depends on |
|---|---|
rem and em | The computed root or relevant element font size |
% | The property-specific quantity represented by 100% |
vw, vh, vmin, vmax | The selected viewport width and height |
in, cm, mm, q, pt, pc | Fixed CSS reference-pixel ratios |
fr distributes leftover grid space and is not a CSS length. Units such as ch, ex, cap, and icdepend on actual font metrics, so a generic numeric conversion would be misleading.
Choosing rem or em does not by itself guarantee accessibility. Test text at 200% and avoid viewport units as the only font-size basis.
Primary sources
Definitions you can verify.
Reviewed August 21, 2026. The converter follows the CSS Values and Units specification and links the accessibility guidance behind its typography note.
