Convert between CSS units like px, em, rem, vw, vh, and percentages.
The CSS Unit Converter converts between px, em, rem, vw, vh, and percentage values based on a base font size or viewport dimension you set. It's free, runs entirely in your browser, and helps you translate fixed pixel values from a design mockup into the relative units needed for responsive, accessible web layouts.
Made for everyone. Typical uses:
Explore more in Converters, read the guides and articles, or see how we test our tools.
Convert pixel values to EM units for responsive web design.
Best for converting a design spec's pixel measurements into em units for a responsive CSS stylesheet
Convert rem to px and px to rem for responsive typography.
Best for converting a Figma or Sketch spec given in pixels into rem for a responsive stylesheet
Convert viewport width units (vw) to pixel values for responsive design.
Best for checking how a hero heading sized in vw will look on a common desktop resolution
Check color contrast ratios for WCAG compliance.
Best for checking that body text color meets WCAG AA contrast requirements before shipping a website
Generate CSS box shadow effects with a visual editor.
Best for adding a subtle drop shadow to a card component to lift it off the page