At the default root font size of 16px, 320px is exactly 20rem.
Calculation based on a root font-size of 16 pixels.
How to convert 320px to rem
To convert pixels to rem, divide the pixel value by the root font size: rem = px ÷ 16. For 320px that is 320 ÷ 16 = 20rem.
320px is a very large size, typically used for hero headings, containers and big layout dimensions.
320px at different root font sizes
| Root font size | Input | Result |
|---|---|---|
| 10px | 320px | 32rem |
| 12px | 320px | 26.6667rem |
| 14px | 320px | 22.8571rem |
| 15px | 320px | 21.3333rem |
| 16px | 320px | 20rem |
| 18px | 320px | 17.7778rem |
| 20px | 320px | 16rem |
| 22px | 320px | 14.5455rem |
| 24px | 320px | 13.3333rem |
CSS examples
font-size: 20rem; /* 320px */
padding: 20rem;
margin-bottom: 20rem;
width: 20rem;The same values in pixels, if you need a fixed size:
font-size: 320px;
padding: 320px;Tailwind CSS equivalent
The default spacing scale has a step for 20rem: use classes like p-80, m-80, gap-80, w-80 and h-80.
Nearby values
Frequently Asked Questions
320px equals 20rem when the root font size is the browser default of 16px. The calculation is 320 ÷ 16 = 20.
20rem equals 320px at a 16px root font size (20 × 16 = 320).
Yes. If the root font size is 18px, 320px equals 17.7778rem, and at 20px it equals 16rem. The pixel value itself never changes, only the rem equivalent. Use the base font size field above to try any value.
Prefer rem for font sizes, spacing and layout so they respect the user's browser font settings and scale for accessibility. Use px for details that should never scale, such as 1px borders or fixed icon sizes.
