CSS Unit Converter

Convert CSS lengths between px, rem, em, viewport units, and percentages using your root size, parent size, and viewport dimensions.

Converted value
1rem
16px equals 1rem.
Using 16px root font size.
Pixel basis
16px
Viewport basis
1440 × 900
Font basis
root 16px / parent 16px

Note: Percent values are treated as a font-size-relative percentage, so 100% equals the parent font size.

Viewport conversions use vw from viewport width, vh from viewport height, and vmin/vmax from the smaller or larger viewport dimension.

About this tool

CSS Unit Converter helps front-end developers, designers, and QA testers convert CSS values between px, rem, em, vw, vh, vmin, vmax, and percent using font-size and viewport context. Use it for searchable workflows like px to rem calculator, rem to px converter, viewport unit conversion, responsive CSS sizing, and design token handoff.

Use cases

  • Convert a pixel value from a mockup into rem or em before adding it to a component, design system, or accessibility-friendly stylesheet.
  • Translate viewport units such as vw, vh, vmin, and vmax into approximate pixel values for a specific screen size during responsive QA.
  • Check percent-based spacing or typography against font-size and viewport assumptions before documenting a CSS rule or code review comment.
  • Copy conversion output into tickets, specs, pull request notes, or QA reports so designers and developers agree on the same sizing context.

FAQ

What is the CSS Unit Converter used for?

Use it to convert CSS measurements between px, rem, em, viewport units, and percentages when you know the relevant font-size and viewport context.

What inputs affect the conversion?

Conversions depend on the source value and unit, target unit, root or parent font size for rem and em, and viewport dimensions for vw, vh, vmin, vmax, and percent-style calculations.

Why does my rem or em result differ from another calculator?

The assumed root font size or parent font size may be different. Confirm whether the workflow uses the browser default 16px, a custom html font-size, or a component-level parent font-size.

Can this replace browser layout testing?

No. It gives copy-friendly math for CSS units, but final layout can still depend on media queries, container size, inheritance, zoom, writing mode, and rendered browser styles.