Home/Tools/Utilities/px to rem Converter
Utilities · Generator

px to rem Converter

Convert between px and rem with a configurable base font size and a full 1–100px conversion table.

Settings

16px
1rem

Base: 16px  •  1rem = 16px

CSS Reference
/* Base font size: 16px */
html {
  font-size: 16px;
}

/* Usage examples */
.element {
  font-size: 1rem;   /* 16px */
  padding: 0.5rem;      /* 8px */
  margin: 1.5rem;      /* 24px */
}

Conversion Table (1px – 100px)

Base font size: 16px

pxremem
1px0.0625rem0.0625em
2px0.125rem0.125em
3px0.1875rem0.1875em
4px0.25rem0.25em
5px0.3125rem0.3125em
6px0.375rem0.375em
7px0.4375rem0.4375em
8px0.5rem0.5em
9px0.5625rem0.5625em
10px0.625rem0.625em
11px0.6875rem0.6875em
12px0.75rem0.75em
13px0.8125rem0.8125em
14px0.875rem0.875em
15px0.9375rem0.9375em
16px1rem1em
17px1.0625rem1.0625em
18px1.125rem1.125em
19px1.1875rem1.1875em
20px1.25rem1.25em
21px1.3125rem1.3125em
22px1.375rem1.375em
23px1.4375rem1.4375em
24px1.5rem1.5em
25px1.5625rem1.5625em
26px1.625rem1.625em
27px1.6875rem1.6875em
28px1.75rem1.75em
29px1.8125rem1.8125em
30px1.875rem1.875em
31px1.9375rem1.9375em
32px2rem2em
33px2.0625rem2.0625em
34px2.125rem2.125em
35px2.1875rem2.1875em
36px2.25rem2.25em
37px2.3125rem2.3125em
38px2.375rem2.375em
39px2.4375rem2.4375em
40px2.5rem2.5em
41px2.5625rem2.5625em
42px2.625rem2.625em
43px2.6875rem2.6875em
44px2.75rem2.75em
45px2.8125rem2.8125em
46px2.875rem2.875em
47px2.9375rem2.9375em
48px3rem3em
49px3.0625rem3.0625em
50px3.125rem3.125em
51px3.1875rem3.1875em
52px3.25rem3.25em
53px3.3125rem3.3125em
54px3.375rem3.375em
55px3.4375rem3.4375em
56px3.5rem3.5em
57px3.5625rem3.5625em
58px3.625rem3.625em
59px3.6875rem3.6875em
60px3.75rem3.75em
61px3.8125rem3.8125em
62px3.875rem3.875em
63px3.9375rem3.9375em
64px4rem4em
65px4.0625rem4.0625em
66px4.125rem4.125em
67px4.1875rem4.1875em
68px4.25rem4.25em
69px4.3125rem4.3125em
70px4.375rem4.375em
71px4.4375rem4.4375em
72px4.5rem4.5em
73px4.5625rem4.5625em
74px4.625rem4.625em
75px4.6875rem4.6875em
76px4.75rem4.75em
77px4.8125rem4.8125em
78px4.875rem4.875em
79px4.9375rem4.9375em
80px5rem5em
81px5.0625rem5.0625em
82px5.125rem5.125em
83px5.1875rem5.1875em
84px5.25rem5.25em
85px5.3125rem5.3125em
86px5.375rem5.375em
87px5.4375rem5.4375em
88px5.5rem5.5em
89px5.5625rem5.5625em
90px5.625rem5.625em
91px5.6875rem5.6875em
92px5.75rem5.75em
93px5.8125rem5.8125em
94px5.875rem5.875em
95px5.9375rem5.9375em
96px6rem6em
97px6.0625rem6.0625em
98px6.125rem6.125em
99px6.1875rem6.1875em
100px6.25rem6.25em
100%
Free, no
sign-up needed
0
Code written
by hand
85+
CSS tools
in one place
<1s
Copy-ready
CSS instantly
What is this

What is the PX to REM Converter?

Convert pixel values to rem units based on your root font-size. See a bulk conversion table and copy individual values instantly.

Everything runs locally in your browser. Adjust the controls above, preview instantly, and copy clean, production-ready CSS — no account, no upload.

How to use

Using the PX to REM Converter

Everything lives in the panel at the top of this page. There is nothing to install — it all runs right here in your browser.

1

Set root font-size

The default browser root font-size is 16px. Most projects keep this. If your project sets html { font-size: 62.5% }, the effective root is 10px.

2

Enter pixel values

Type a pixel value to see its rem equivalent. Or use the bulk table to see common pixel values (8px to 64px) converted at a glance.

3

Copy the rem value

Click a value in the table to copy it to the clipboard.

The output

What the generated code looks like

Clean, production-ready CSS — no vendor bloat, no unnecessary declarations.

converted.css
/* Root font-size: 16px */
/* Formula: rem = px / root-font-size */

h1 { font-size: 2rem; }      /* 32px */
h2 { font-size: 1.5rem; }    /* 24px */
h3 { font-size: 1.25rem; }   /* 20px */
p  { font-size: 1rem; }      /* 16px */

.small { font-size: 0.875rem; } /* 14px */
.tiny  { font-size: 0.75rem; }  /* 12px */

.card  { padding: 1.5rem; }   /* 24px */
.hero  { padding: 3rem 4rem; } /* 48px 64px */
Common mistakes & fixes

Common mistakes & how to fix them

A few habits trip people up. Here is what to watch for — and the exact fix.

Using px for font-size instead of rem

Pixel font sizes override the user's browser font size setting. Users who set their browser to 20px for accessibility will still see 16px text if font-size is in px.

Fix: Use rem for font-size. The cascade from the browser root font-size allows user preferences to scale all text proportionally.

Pro tips

Pro tips for better results

Use rem for font-size and spacing, px for borders

rem ensures typography and spacing scale with user font preferences. px is appropriate for borders (1px border should stay 1px regardless of font zoom) and small fixed decorative elements.

FAQ

Frequently asked questions

Setting html { font-size: 62.5%; } makes 1rem = 10px, simplifying mental math (16px = 1.6rem). It respects the user's browser font-size setting because 62.5% is relative to the user's preference. A user with 20px preference gets 1rem = 12.5px.
rem is relative to the root font-size (predictable). em is relative to the current element's font-size (compounding in nested elements). Use rem for most font-size and spacing. Use em for values that should scale relative to the local font-size, like padding on buttons.

From the blog

Read more