Boneyard Tools

CSS Unit Converter

Convert a length between the common CSS units px, rem, em and pt. Set the root font size that rem and em are relative to, type a value, and read the result in every other unit. Everything runs in your browser.

How to convert CSS units

  1. Set the root font size if it is not the default 16px.
  2. Enter a value and choose the unit you are converting from.
  3. Read or copy the equivalent value in px, rem, em and pt.

Examples

Pixels to rem

16px at base 16
1rem

Points to pixels

12pt
16px

Frequently asked questions

How do you convert px to rem?

Divide the pixel value by the root font size. At the default root size of 16px, 16px is 1rem, 24px is 1.5rem, and 8px is 0.5rem.

How many pixels is 1pt?

CSS defines 1pt as 1/72 of an inch and 1 inch as 96px, so 1pt equals 96/72 px, about 1.3333px. That makes 12pt exactly 16px.

What is the difference between rem and em?

rem is relative to the root font size, while em is relative to the font size of the current element. This tool converts both against the base you set, which is the common case for sizing.

Why would I use rem instead of px?

rem scales with the user's root font size, so layouts respect browser and accessibility settings. Many designers size typography and spacing in rem for that reason.

Is anything sent to a server?

No. The conversion runs in your browser, so your values never leave your device.

Related tools