Toolstia / CSS unit converter

CSS unit converter

Enter a value and choose the unit it is in. The tool shows it in every common CSS unit at once, including px to rem, which is the conversion developers need most. You can change the root font size and the viewport size.

Absolute units use CSS definitions: 1 in = 96 px, 1 pt = 1/72 in, 1 pc = 16 px. rem and em use the root font size you set (16 px is the browser default; em is treated the same as rem here). vw and vh are one percent of the viewport width and height.

How it works

  1. Enter a value and pick the unit to convert from.
  2. Pick the unit to convert to and set the root font size if it is not 16 px.
  3. Read the result and the full table.

px to rem

Divide the pixels by the root font size. With the default 16 px, 24 px is 1.5 rem. Using rem lets text scale when people change their browser font size.

Absolute units

CSS fixes these: 1 inch is 96 px, 1 pt is 1/72 inch, 1 pc is 16 px, 1 cm is about 37.8 px and 1 mm is about 3.78 px.

Viewport units

vw is one percent of the viewport width and vh is one percent of its height. Enter the viewport size to get a pixel value.

rem and em

rem is relative to the root font size. em is relative to the parent element’s font size, which this tool treats as the same base value.

Questions

What is the default root font size?

Browsers use 16 px by default, so 1 rem is 16 px unless the page changes it.

Why is 1 pt not 1 px?

A point is 1/72 of an inch and a CSS pixel is 1/96 of an inch, so 1 pt is about 1.333 px.

Is my data stored?

Everything happens in your browser, and nothing you enter is sent anywhere.