CSS Unit Converter

Convert between px, rem, em, vw, vh, %, pt, cm, mm, and in with configurable settings.

Quick Conversions

Convert

16px = 1rem = 16px

Size Preview

Conversion Formulas

px to rem
rem = px / baseFontSize
px to em
em = px / parentFontSize
px to vw
vw = px / viewportWidth * 100
px to vh
vh = px / viewportHeight * 100
px to pt
pt = px * 72 / 96
px to cm
cm = px * 2.54 / 96
px to %
% = px / parentFontSize * 100
px to in
in = px / 96

Bulk Conversion Table

pxrememptvwvhcmin

Common Reference

1rem
= 16px
1em
= 16px (of parent)
1vw
= 19.2px
1vh
= 10.8px
1pt
= 1.333px
1cm
= 37.795px
1in
= 96px
1mm
= 3.78px
100%
= 16px (of parent)
Best Practices: Use rem for font sizes (scales with root font settings). Use em for component-level spacing that should scale with the component's font size. Use px for borders and shadows. Use vw/vh for full-screen layouts. Use % for fluid widths inside containers. Avoid mixing too many unit types in one component.

Unlock 100+ Premium Tools

Get the NexTool Pro with templates, workflows, and AI prompts for just $29.

Copied!