N
NJHTools

CSS Unit Converter

Convert px to rem, em, %, pt (and vw/vh) instantly. Type in any field and the rest update live — with an adjustable base font size, right in your browser.

px → rem reference table

pxrem @ 16pxrem @ 14pxrem @ 18pxCopy
12px0.75rem0.8571rem0.6667rem
14px0.875rem1rem0.7778rem
16px1rem1.1429rem0.8889rem
18px1.125rem1.2857rem1rem
20px1.25rem1.4286rem1.1111rem
24px1.5rem1.7143rem1.3333rem
28px1.75rem2rem1.5556rem
32px2rem2.2857rem1.7778rem
40px2.5rem2.8571rem2.2222rem
48px3rem3.4286rem2.6667rem

Copy button uses the 16px base. Most common values: 16px = 1rem, 24px = 1.5rem, 32px = 2rem.

How to use the CSS unit converter

  1. Type a value into any unit field — px, rem, em, %, or pt — and the others update instantly.
  2. Adjust the base font size (used for rem), the parent font size (for em and %), or the viewport (for the bonus vw/vh values).
  3. Click Copy next to any field or table row to grab the value with its unit.

By default 1rem = 16pxbecause that is the browser's default root font size, but you can change the base above. pt uses the CSS reference of 96px per inch, so 1px = 0.75pt and 1pt = 1.3333px. Everything is computed locally — no data is ever sent to a server.

Frequently Asked Questions

How many rem is 24px?↓

At the default base font size of 16px, 24px equals 1.5rem (24 ÷ 16). If your root font size is different, divide the pixel value by that number — for example at an 18px base, 24px is about 1.333rem.

How many rem is 32 pixels?↓

32px equals 2rem at the standard 16px base font size (32 ÷ 16 = 2). Common conversions at a 16px base: 12px = 0.75rem, 14px = 0.875rem, 16px = 1rem, 20px = 1.25rem, and 32px = 2rem.

How do I convert px to rem?↓

Divide the pixel value by the root font size. With the browser default of 16px, 16px equals 1rem, 24px equals 1.5rem, and 32px equals 2rem. This converter does the math automatically and lets you change the base font size if your project uses a different root size.

What is the difference between rem and em?↓

rem is always relative to the root (html) font size, while em is relative to the font size of the current element's parent. rem gives predictable, consistent sizing across a page, whereas em compounds when elements are nested.

How are px and pt related in CSS?↓

In CSS, 1 inch is defined as 96px and 1 inch is 72pt, so 1pt equals 96/72 = 1.3333px and 1px equals 0.75pt. These are reference units and do not depend on the physical resolution of the screen.

How do vw and vh units work?↓

1vw equals 1% of the viewport width and 1vh equals 1% of the viewport height. So on a 1920px-wide viewport, 10vw equals 192px. Because the pixel result depends on the viewport, this converter lets you set the viewport width and height used for the calculation.

Is this CSS unit converter free and private?↓

Yes. The CSS Unit Converter is completely free with no signup required, and it runs 100% locally in your browser. No values you enter are ever uploaded to or stored on any server.

Last updated: