How to Convert Pixel (CSS 96 DPI) to rem / em (16px root)
In CSS web design, pixels (px) are fixed-reference units at 96 DPI, whereas rem ('root em') scales relative to the root html element's font size—defaulting to 16px in almost all browsers. Dividing any pixel size by 16 yields its exact rem value.
Front-end developers and UI designers convert px to rem to build responsive spacing, fluid typography, and accessible layouts that respect user browser zoom and font-size preferences.
rem = px ÷ 16 (at standard 16px root html font-size)
Need to convert in the opposite direction? Open our dedicated REM to PX Converter.
Worked Step-by-Step Examples
- Example 1 — Button Padding (12 px to rem): Divide 12 by 16 →
12 ÷ 16 = 0.75rem. - Example 2 — Card Heading (24 px to rem): Divide 24 by 16 →
24 ÷ 16 = 1.5rem.
Quick Reference Conversion Table
| Pixel (CSS 96 DPI) (px) | rem / em (16px root) (rem) | Pixel (CSS 96 DPI) (px) | rem / em (16px root) (rem) |
|---|---|---|---|
| 1 px | 0.0625 rem | 50 px | 3.125 rem |
| 5 px | 0.3125 rem | 75 px | 4.6875 rem |
| 10 px | 0.625 rem | 100 px | 6.25 rem |
| 20 px | 1.25 rem | 250 px | 15.625 rem |
| 25 px | 1.5625 rem | 500 px | 31.25 rem |
Frequently Asked Questions
What is 16px in rem?
At the default 16px root font size, 16px equals exactly 1rem.
Why use rem instead of px in CSS?
Using rem scales typography cleanly when users change their browser's default font size for accessibility.
What is 20px in rem?
20px divided by 16 equals 1.25rem.