UtilVox
straighten

Pixel to REM Converter

Convert px to rem and em instantly based on custom root font settings.

Base Font Size

Usually 16px (browser default)

8pxCurrent: 16px32px
PX
Formula
24px ÷ 16 = 1.5rem
Result
1.5rem
EM Value
1.5em
Percent
150%

Common Scales

PXREMEMTW
8px0.5rem0.5emw-2
10px0.625rem0.625emw-2.5
11px0.6875rem0.6875emw-2.75
12px0.75rem0.75emw-3
13px0.8125rem0.8125emw-3.25
14px0.875rem0.875emw-3.5
15px0.9375rem0.9375emw-3.75
16px1rem1emw-4
18px1.125rem1.125emw-4.5
20px1.25rem1.25emw-5
24px1.5rem1.5emw-6
28px1.75rem1.75emw-7
32px2rem2emw-8
36px2.25rem2.25emw-9
40px2.5rem2.5emw-10
48px3rem3emw-12
56px3.5rem3.5emw-14
64px4rem4emw-16
72px4.5rem4.5emw-18
80px5rem5emw-20
96px6rem6emw-24

Tailwind Scale

Step 1
0.25rem
4px
Step 2
0.5rem
8px
Step 4
1rem
16px
Step 8
2rem
32px
Step 12
3rem
48px
Step 16
4rem
64px
tips_and_updatesPro Tip

"Always use REMs for typography and major spacing. It ensures your UI respects user accessibility settings, like custom browser font sizes."

REM vs PX: Which should you use?

zoom_inThe Case for REM

REM units are relative to the root font-size. This is the gold standard for accessibility. If a user increases their browser's default font size, your entire layout will scale proportionally, keeping the design readable and usable.

straightenThe Case for PX

Pixel units are absolute. Use them for elements that should never scale, such as 1px borders, subtle drop shadows, or decorative elements where pixel-perfection is required regardless of text size.

Common Questions

px to rem, and Why It's Not Just Division

The conversion table (16px base)

With the default 16px root size, the values you'll convert daily:

pxremTypical role
120.75Captions, fine print
140.875Secondary text
161Body text — the anchor
20 / 241.25 / 1.5H3 / H2
32 / 482 / 3H1 / display
4 / 8 / 16 / 240.25 / 0.5 / 1 / 1.5The spacing scale

The reason rem exists

Users change their browser's base font size — for eyesight, by preference, or via OS accessibility settings. rem-based sizes scale with that choice; px-based sizes ignore it. Set text and spacing in rem and a user who bumps their default to 20px gets a proportionally larger, still-coherent layout instead of tiny fixed text. The places px stays right: borders (1px is a crisp line at any scale), and tiny detail offsets where scaling adds nothing.

Converting a legacy stylesheet

Migrating px → rem mechanically (divide by 16) is safe; the win is doing it onto a scale — snap stray 13px and 15px values to 0.875rem and 1rem while you're there, and the design tightens for free. The sizes feed your grid and flex gaps, and the slimmed result ships through the CSS minifier.