CSS Unit Converter

Convert CSS length units — px, rem, em, pt and % — live in your browser. Set a root font size and every unit updates instantly.

Every conversion is computed locally in your browser; the values you type are never uploaded.

Working with CSS colors? Try the CSS Color Converter.

About CSS Unit Converter

This CSS unit converter turns a length you type in one unit into every other CSS unit at once — px, rem, em, pt and %. Enter a value in any field and the others update live, so you can read a px to rem or pt to px result without doing the math by hand. A root font size input (16px by default) drives the rem, em and % relationships, which mirrors how browsers resolve relative units against the page's font size. A built-in quick reference shows the common px-to-rem values designers reuse — 12, 14, 16, 24, 32 and more — at your chosen base. Each result has a copy button so you can drop it straight into a stylesheet. Everything runs in your browser, so the values you type stay on your device.

Features

How to use the CSS Unit Converter

  1. Set the root font size if it differs from the 16px browser default.
  2. Type a value into any unit field — px, rem, em, pt or %.
  3. Read the equivalent value in every other unit as it updates live.
  4. Click the copy button next to a unit to grab the value with its suffix.
  5. Use the quick reference table for common px-to-rem pairs at your base.

Example

Input

/* root font-size: 16px */
.card { padding: 24px; }

Output

.card { padding: 1.5rem; }

/* 24px = 1.5rem = 18pt = 150% at base 16px */

At a 16px base, 24px equals 1.5rem — handy for switching a layout to rem.

Common errors & troubleshooting

Frequently asked questions

How do I convert px to rem?
Type the pixel value into the px field and read the rem field. rem is the value divided by the root font size, so at the default 16px base, 16px is 1rem and 24px is 1.5rem.
How do I convert rem to px?
Type the value into the rem field and read px. rem to px is the value multiplied by the root font size, so 2rem at a 16px base is 32px.
What base font size does the converter use?
It defaults to 16px, the standard browser root font size, and you can change it in the Root font size field. That base drives every rem, em and % result so they match your stylesheet.
Why is 1pt equal to 1.3333px here?
CSS defines 1pt as 1/72 inch and 1px as 1/96 inch, so 1pt = 96/72 px = 1.3333px. That is why 12pt converts to exactly 16px, the common body-text size.
What is the difference between em and rem?
rem is relative to the root font size, while em is relative to the element's own font size. This tool uses one base for both for simplicity, so they read the same; set the root font size to model the rem side.
Is the conversion done on a server?
No. The CSS unit conversion runs entirely in your browser with plain arithmetic, so the values you enter stay on your device.

Related tools

All ArrayKit tools