frontendhack-logo
31.7rem = 507.2px

At the default root font size of 16px, 31.7rem is exactly 507.2px.

Calculation based on a root font-size of 16 pixels.

How to convert 31.7rem to px

To convert rem to pixels, multiply the rem value by the root font size: px = rem × 16. For 31.7rem that is 31.7 × 16 = 507.2px.

507.2px is a very large size, typically used for hero headings, containers and big layout dimensions.

31.7rem at different root font sizes

Root font sizeInputResult
10px31.7rem317px
12px31.7rem380.4px
14px31.7rem443.8px
15px31.7rem475.5px
16px31.7rem507.2px
18px31.7rem570.6px
20px31.7rem634px
22px31.7rem697.4px
24px31.7rem760.8px

CSS examples

font-size: 31.7rem; /* 507.2px */
padding: 31.7rem;
margin-bottom: 31.7rem;
width: 31.7rem;

The same values in pixels, if you need a fixed size:

font-size: 507.2px;
padding: 507.2px;

Tailwind CSS equivalent

31.7rem is not part of the default Tailwind scale, but you can use an arbitrary value such as p-[31.7rem] or text-[31.7rem].

Nearby values

REMPixels
31.2rem499.2px
31.3rem500.8px
31.4rem502.4px
31.5rem504px
31.6rem505.6px
31.7rem507.2px
31.8rem508.8px
31.9rem510.4px
32rem512px
32.1rem513.6px
32.2rem515.2px

Frequently Asked Questions

31.7rem equals 507.2px when the root font size is the browser default of 16px. The calculation is 31.7 × 16 = 507.2.

507.2px equals 31.7rem at a 16px root font size (507.2 ÷ 16 = 31.7).

Yes. rem is relative to the root font size, so 31.7rem becomes 570.6px at an 18px root and 634px at a 20px root. 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.