All tools CSS Unit Converter ● Live Developer Tools

How CSS Unit Converter works

  1. Enter a value and choose its starting unit (px, rem, em, %, vh, vw, pt, cm, mm, or in).
  2. Adjust the context fields if needed: base font size, parent element size, and viewport width/height.
  3. View the converted value across all ten units instantly in the 'All Equivalents' list.
  4. Copy whichever converted value you need for your CSS.
  • Convert a design mockup's pixel measurements into rem units for accessible, scalable typography.
  • Check what a percentage-based width equals in pixels for a specific parent container size.
  • Translate a fixed px value into vw/vh to make an element scale with the viewport.
  • Verify how a cm or mm measurement from a print spec would translate to px for a web layout.
  • Sanity-check em-based spacing when nested elements have different font sizes.

All unit math runs locally in your browser using JavaScript. No values are transmitted anywhere.

  • vh/vw conversions depend on the viewport size you enter manually — they don't read your actual browser window.
  • em conversions use a single 'parent element' font size field, not a full simulation of nested cascading font sizes.
  • Physical units (cm, mm, in) use the CSS spec's fixed 96px-per-inch reference, not your display's actual pixel density.

CSS Unit Converter

CSS Unit Converter helps frontend developers translate common CSS units for responsive layout work. It is useful for checking spacing, typography, and viewport-based sizing without manual math.

CSS Unit Converter Runs locally

Input

Context

All Equivalents

px16 px
rem1 rem
em1 em
%100 %
vh1.77778 vh
vw1.11111 vw
pt12 pt
cm0.423333 cm
mm4.23333 mm
in0.166667 in
Guide

How to use

  1. Enter a value and choose its starting unit (px, rem, em, %, vh, vw, pt, cm, mm, or in).

  2. Adjust the context fields if needed: base font size, parent element size, and viewport width/height.

  3. View the converted value across all ten units instantly in the 'All Equivalents' list.

  4. Copy whichever converted value you need for your CSS.

Scenarios

Use cases

  • Convert a design mockup's pixel measurements into rem units for accessible, scalable typography.

  • Check what a percentage-based width equals in pixels for a specific parent container size.

  • Translate a fixed px value into vw/vh to make an element scale with the viewport.

  • Verify how a cm or mm measurement from a print spec would translate to px for a web layout.

  • Sanity-check em-based spacing when nested elements have different font sizes.

Good to know

Limitations & Privacy

Private by design

All unit math runs locally in your browser using JavaScript. No values are transmitted anywhere.

  • vh/vw conversions depend on the viewport size you enter manually — they don't read your actual browser window.

  • em conversions use a single 'parent element' font size field, not a full simulation of nested cascading font sizes.

  • Physical units (cm, mm, in) use the CSS spec's fixed 96px-per-inch reference, not your display's actual pixel density.

FAQ

Frequently asked questions

Is CSS Unit Converter free to use?

Yes. The tool is free and runs directly in your browser with no account required.

Does this tool upload my data?

No. All conversion happens locally in the browser tab. Nothing is sent to a server.

Which units does it support?

px, rem, em, %, vh, vw, pt, cm, mm, and in. Enter a value in any one unit and see the equivalent value in all the others simultaneously.

How does it handle rem vs em?

rem is calculated against the 'Base font size' field (the root element's font size), while em and percent are calculated against the separate 'Parent element' field, matching how they actually cascade in CSS.

How are vh and vw calculated?

Using the 'Viewport width' and 'Viewport height' fields you set, so you can check how a viewport-relative value would render at a specific screen size (e.g. 1440x900 for desktop or 375x812 for mobile).

Why would I convert px to rem?

Using rem units for font sizes and spacing lets values scale when a user changes their browser's default font size, which is a common accessibility and responsive design practice.

Are physical units like cm, mm, and in accurate for screen display?

They're converted using the CSS specification's fixed reference (96px = 1 inch), which is standard for print stylesheets but won't exactly match physical size on every screen due to differing pixel densities.