CSS unit converters
72 conversions between the CSS length units, each with a live converter that respects your project's root font size.
The units
| Unit | Type | In pixels (16 px base) |
|---|---|---|
px | Absolute | 1 px |
rem | Relative | 16 px |
em | Relative | 16 px |
pt | Absolute | 1.3333 px |
pc | Absolute | 16 px |
in | Absolute | 96 px |
cm | Absolute | 37.7953 px |
mm | Absolute | 3.7795 px |
% | Relative | 0.16 px |
Absolute vs relative
Absolute units (px, pt, pc, in, cm, mm) always render at the same size regardless of context. Relative units (rem, em, %) are computed from a font size — the root element for rem, the current element for em and percent — which is what makes them respond to user preferences and to a responsive type scale.
The accessibility argument for rem
When a visitor raises their browser's default font size, text sized in px does not move. Text sized in rem does. That single difference is why almost every modern design system expresses type and spacing in rem and reserves px for borders and one-pixel details.
All conversions
- px to rem
- px to em
- px to pt
- px to pc
- px to in
- px to cm
- px to mm
- px to %
- rem to px
- rem to em
- rem to pt
- rem to pc
- rem to in
- rem to cm
- rem to mm
- rem to %
- em to px
- em to rem
- em to pt
- em to pc
- em to in
- em to cm
- em to mm
- em to %
- pt to px
- pt to rem
- pt to em
- pt to pc
- pt to in
- pt to cm
- pt to mm
- pt to %
- pc to px
- pc to rem
- pc to em
- pc to pt
- pc to in
- pc to cm
- pc to mm
- pc to %
- in to px
- in to rem
- in to em
- in to pt
- in to pc
- in to cm
- in to mm
- in to %
- cm to px
- cm to rem
- cm to em
- cm to pt
- cm to pc
- cm to in
- cm to mm
- cm to %
- mm to px
- mm to rem
- mm to em
- mm to pt
- mm to pc
- mm to in
- mm to cm
- mm to %
- % to px
- % to rem
- % to em
- % to pt
- % to pc
- % to in
- % to cm
- % to mm