frontendhack-logo
320px = 20rem

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 sizeInputResult
10px320px32rem
12px320px26.6667rem
14px320px22.8571rem
15px320px21.3333rem
16px320px20rem
18px320px17.7778rem
20px320px16rem
22px320px14.5455rem
24px320px13.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

PixelsREM
320px20rem
2px0.125rem
3px0.1875rem
4px0.25rem
5px0.3125rem
6px0.375rem

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.