CSS Unit Converter
Converts a CSS length into every common unit.
Pixels
— px
Share sends a link that reopens these numbers. Copy details pastes the full breakdown as a list.
rem — rem
em — em
Percent of parent font size — %
Points — pt
Viewport width — vw
Viewport height — vh
Inches — in
Centimetres — cm
Millimetres — mm
The formula
px = value × factor 1 in = 96 px = 72 pt = 2.54 cm 1 rem = root font size
CSS fixes an inch at 96 px, so a CSS inch matches a ruler only on some screens. Percent means different things on different properties, and here it means percent of the parent font size.
What to watch out for
Relative units depend on the page, so set the font sizes and viewport to match yours.
Frequently Asked Questions
How many pixels is 12 pt?
16 px.
What is 24 px in rem?
1.5 rem, with a 16 px root.