Dev & Web
CSS Unit Converter
Convert between px, rem, em, pt, cm, mm, in, vw, and vh instantly. Set your root and parent font sizes for accurate rem and em calculations.
How it works
All conversions go through pixels as a common base. Enter a value and source unit, and the tool converts to every other CSS unit simultaneously using your context settings for relative units like rem, em, vw, and vh.
Frequently asked questions
What is the difference between px and rem?
px is an absolute unit - 1px equals one device pixel (at 1x zoom). rem is relative to the root font size. If root font size is 16px, 1rem = 16px. rem scales with user accessibility settings.
When should I use em vs rem?
Use em for spacing that should scale with its parent element (e.g. padding inside a component). Use rem for global sizes like base font sizes and layout spacing that should scale consistently.
What is the px to pt conversion?
1px = 0.75pt at 96 DPI (the web standard). So 16px = 12pt. Points are commonly used in print design and some CSS for font sizes.
What are viewport units (vw, vh)?
vw is 1% of the viewport width, vh is 1% of the viewport height. They are useful for responsive layouts: 100vw = full browser width, 50vh = half the browser height.