CSS Unit Converter

CSS Unit Converter

Convert between px, rem, em, pt, vw, vh, %, cm, mm, and in

Result1rem

16px = 1rem (base: 16px)

Quick Reference

16px=1rem
12pt=16px
1in=96px
1cm=37.795px
10mm=37.795px
100vw=1920px *
100vh=1080px *
1rem=16px

* Viewport-based values assume default 1920x1080 viewport. Adjust settings above for your target dimensions.

What are CSS Units?

CSS units define the size of elements, spacing, and typography on web pages. Choosing the right unit is critical for building responsive, accessible websites. CSS units fall into two categories: absolute units and relative units.

This tool lets you convert between the most common CSS units instantly. Enter a value, select your source and target units, and see the result in real time. All calculations happen in your browser — nothing is sent to a server.

Absolute vs. Relative Units

Absolute Units

Absolute units have a fixed size regardless of the parent element or viewport. They are best for print stylesheets or precise pixel control.

  • px — Pixels, the most common absolute unit
  • pt — Points (1pt = 1.333px), used in print
  • cm / mm / in — Physical units mapped to CSS pixels

Relative Units

Relative units scale based on another value such as the font size or viewport dimensions. They are essential for responsive design.

  • rem — Relative to root font size
  • em — Relative to parent font size
  • vw / vh — Relative to viewport width / height
  • % — Relative to parent element

When to Use Each Unit

UnitBest ForExample
remFont sizes, spacing, layoutfont-size: 1.25rem
pxBorders, shadows, fine detailsborder: 1px solid
vw/vhFull-screen sections, fluid textheight: 100vh
emComponent-scoped scalingpadding: 0.5em 1em
%Widths, fluid layoutswidth: 50%
ptPrint stylesheetsfont-size: 12pt

Frequently Asked Questions