MockFoxAdvertise

PX to REM Converter

Updated Free mock REST & WebSocket APIs

Type a pixel value to get rem, em, pt and percent — or type in any box and the others update. Set your root font size if it isn't the browser default of 16px, and convert a whole CSS snippet at once.

24px = 1.5rem = 18pt (at 16px root)

Common values at 16px
pxremptTailwind
1px0.0625rem0.75pt—
2px0.125rem1.5pt—
4px0.25rem3ptp-1
6px0.375rem4.5pt—
8px0.5rem6ptp-2
10px0.625rem7.5pt—
12px0.75rem9ptp-3
13px0.8125rem9.75pt—
14px0.875rem10.5pt—
15px0.9375rem11.25pt—
16px1rem12ptp-4
18px1.125rem13.5pt—
20px1.25rem15ptp-5
22px1.375rem16.5pt—
24px1.5rem18ptp-6
28px1.75rem21ptp-7
32px2rem24ptp-8
36px2.25rem27ptp-9
40px2.5rem30ptp-10
44px2.75rem33ptp-11
48px3rem36ptp-12
56px3.5rem42ptp-14
64px4rem48ptp-16
72px4.5rem54ptp-18
80px5rem60ptp-20
96px6rem72ptp-24
128px8rem96ptp-32
Convert a CSS snippet (px → rem, keeps 0 and 1px borders)

🔒 Calculated instantly in your browser.

How to convert px to rem

  1. Check the root font size — 16px unless your CSS sets html { font-size }.
  2. Type a value in px (or any other unit); all the other units update instantly.
  3. Use the table for common sizes, or paste CSS below to rewrite every px value as rem.

The formula

rem = px ÷ root font size. With the default 16px root: 24px ÷ 16 = 1.5rem, 14px ÷ 16 = 0.875rem. The other way round, px = rem × 16.

pxrem (16px root)rem (10px root)pt
10px0.625rem1rem7.5pt
12px0.75rem1.2rem9pt
14px0.875rem1.4rem10.5pt
16px1rem1.6rem12pt
18px1.125rem1.8rem13.5pt
20px1.25rem2rem15pt
24px1.5rem2.4rem18pt
32px2rem3.2rem24pt
48px3rem4.8rem36pt

rem vs em vs px

  • px is fixed. It ignores the user's browser font-size setting.
  • rem is relative to the root (html) font size, so everything scales together when a user picks a larger default font — the main accessibility reason to use rem for font sizes and spacing.
  • em is relative to the parent's font size and compounds when nested (1.2em inside 1.2em = 1.44× the root). Handy for padding that should scale with a component's own text.
  • pt is a print unit: 1pt = 1/72 inch and 1px = 1/96 inch in CSS, so 12pt = 16px.

The 62.5% trick

Setting html { font-size: 62.5%; } makes 1rem = 10px (62.5% of 16px), so 14px is simply 1.4rem. It still respects user settings, because it's a percentage. Set the root size above to 10 to convert for such projects.

Related tools

Embed this tool on your site

Browse all embeddable tools →

Free for blogs, HR, payroll and contractor sites: copy one snippet — the widget sizes itself and matches your colors.

Get the embed code

Frequently asked questions

How many px is 1rem?

16px by default, because browsers use a 16px root font size. If your CSS changes the html font-size, 1rem equals that size instead.

Should I use rem or px for media queries?

Use em (or rem) — em-based media queries respond to the user's font-size setting in every browser. 48em = 768px at the default size.

Do I need rem for borders?

No. 1px hairline borders are usually kept in px so they stay crisp; the snippet converter leaves 0 and 1px values alone.

How do I convert rem to px?

Multiply by the root font size: 1.5rem × 16 = 24px. Type into the rem box above, or use the rem to px converter.

Your business here? Sponsor this tool from $16/week. See placements