20px → REM

20px to REM — 1.25rem at 16px Base

At the default browser root size of 16px, 20px equals 1.25rem. Formula: rem = px ÷ 16.

Last reviewed:

CSS snippet

.example {
  font-size: 1.25rem; /* 20px at 16px root */
  padding: 1.25rem;
}

PX to REM formula

rem = px ÷ root font size

20px ÷ 16px = 1.25rem

Worked example: To convert 20px at a 16px root, divide 20 by 16. 20 ÷ 16 = 1.25. Write font-size: 1.25rem; instead of font-size: 20px; so text scales when users enlarge their browser default font size.

Common use cases at 20px (1.25rem)

Category Tailwind / design use CSS property example
Font size text-xl (1.25rem) font-size: 1.25rem;
Spacing padding: 1.25rem;
Gap / margin gap: 1.25rem;

Nearby pixel conversions

Also see 18px to rem and 24px to rem .

20px to REM FAQ

How do you convert 20px to rem?

Divide 20 by the root font size. At the default 16px base: 20 ÷ 16 = 1.25rem. Formula: rem = px ÷ root font size.

What is 20px in rem at 16px base?

At a 16px root font size, 20px equals exactly 1.25rem. This is the browser default unless your project or the user changes html { font-size }.

Should I use 1.25rem or 20px in CSS?

Use 1.25rem for typography and spacing that should scale with the user's root font-size preference — important for accessibility. Reserve 20px for fixed values like 1px borders or bitmap image dimensions.

How do I convert 1.25rem back to pixels?

Multiply 1.25rem by 16: 1.25 × 16 = 20px. Reverse formula: px = rem × root font size.

Where is 20px commonly used in web design?

20px (1.25rem) maps to text-xl (1.25rem) in typical design systems. For Tailwind spacing, see —. Check the use-case table on this page for CSS property examples.

Full converter

PX to REM Converter — any value, custom base

Cheat sheet

PX to REM cheat sheet — 12px through 64px