Unit Converter · Length & font-size

20px to rem

20px = 1.25rem

Assumes a root font-size of 16px (the browser default). Adjust it in the calculator below if your project uses a different base.

Quick converter

Type into any field — every unit in this category updates instantly.

Root font-size 16px

Common px → rem values

Click any row to open its dedicated page.

pxrem
4px 0.25rem
6px 0.375rem
8px 0.5rem
10px 0.625rem
12px 0.75rem
14px 0.875rem
16px 1rem
18px 1.125rem
20px 1.25rem
24px 1.5rem
28px 1.75rem
32px 2rem
36px 2.25rem
40px 2.5rem
44px 2.75rem
48px 3rem
56px 3.5rem
64px 4rem
72px 4.5rem
80px 5rem
96px 6rem
112px 7rem
128px 8rem
144px 9rem
160px 10rem
192px 12rem
224px 14rem
256px 16rem

Convert 20px to other units

Formula

rem = px ÷ root-font-size and px = rem × root-font-size. Browsers default the root font-size to 16px, so 1rem normally equals 16px unless the page (or the user's browser settings) changes it.

em works the same way, but relative to the parent element's font-size rather than the root — the numbers only match rem when nothing in the ancestor chain has resized the font.

pt is a print unit: 1pt = 1.333px, based on the fixed 96px-per-inch / 72pt-per-inch relationship browsers use.

Use it in code

Click to copy.