CSS Unit Converter

Convert CSS length units between px, rem, em, vw, vh, pt, and percentage with base font size.

Absolute unit, one screen pixel

1rem

Relative to the font-size of the root <html> element

Equals16px

All unit conversions

Pixel
16px
Root font size
1rem
Parent font size
1em
Viewport width
0.833333vw
Viewport height
1.48148vh
Point
12pt
Pica
1pc
Centimeter
0.423333cm
Millimeter
4.23333mm
Inch
0.166667in
Percent
100%

About CSS Unit Converter — Detailed Guide

Category: Unit Converters 100% Browser-Local

Responsive Web Design (RWD) and modern design systems require constant conversions between absolute units (px, pt, in) and relative typographic units (rem, em, vw, vh, %). Rem units in particular, which scale relative to the root `<html>` font-size, are the industry gold standard for accessible, dynamic layout scaling.

This CSS unit converter supports bidirectional calculations across 11 CSS units: px, rem, em, vw, vh, pt, pc, cm, mm, in, and %. With configurable base font size (default 16px) and customizable viewport dimensions (default 1920x1080), it provides instantaneous conversions to streamline your styling and UI implementation workflow.

#css #unit #px #rem #em #vw #vh #convert

Key Features & Capabilities

  • Full coverage of 11 CSS units: px, rem, em, vw, vh, pt, pc, cm, mm, in, and %
  • Configurable Root Base Font Size (default 16px) to match custom CSS resets like 62.5%
  • Adjustable viewport width and height dimensions for exact vw and vh calculations
  • Purely client-side offline execution with instant reactive formatting and one-click copy

How to Use

  1. 1

    Type your numeric value and select the source CSS unit (e.g. 24 px).

  2. 2

    Choose your desired target unit from the dropdown (e.g. rem or vw).

  3. 3

    Optionally adjust the base font size or viewport settings to immediately view and copy the output.

Common Use Cases

  • → Translating static pixel values from Figma or Sketch design specs into accessible rem values
  • → Converting fixed-width cards or full-screen hero elements into viewport-relative vw/vh units
  • → Converting print-oriented typographic points (pt) from PDF specs into web-compatible pixels

Related Tools

Frequently Asked Questions & Privacy

What is the key advantage of using rem over px in modern web layouts?

Pixels are static and ignore user accessibility preferences. Rem units scale proportionally with the browser root font size, allowing visually impaired users to enlarge site text seamlessly without breaking container layouts.

How does the popular 62.5% font-size trick affect rem conversion?

By setting `html { font-size: 62.5%; }`, the browser default 16px base becomes 10px. Under this convention, 1.4rem equals 14px, and 2.4rem equals 24px. You can configure the Base Font Size setting to 10px in this tool to test those conversions.