frontendhack-logo
304px = 19rem

At the default root font size of 16px, 304px is exactly 19rem.

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

How to convert 304px to rem

To convert pixels to rem, divide the pixel value by the root font size: rem = px ÷ 16. For 304px that is 304 ÷ 16 = 19rem.

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

304px at different root font sizes

Root font sizeInputResult
10px304px30.4rem
12px304px25.3333rem
14px304px21.7143rem
15px304px20.2667rem
16px304px19rem
18px304px16.8889rem
20px304px15.2rem
22px304px13.8182rem
24px304px12.6667rem

CSS examples

font-size: 19rem; /* 304px */
padding: 19rem;
margin-bottom: 19rem;
width: 19rem;

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

font-size: 304px;
padding: 304px;

Tailwind CSS equivalent

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

Nearby values

PixelsREM
304px19rem
2px0.125rem
3px0.1875rem
4px0.25rem
5px0.3125rem
6px0.375rem

Frequently Asked Questions

304px equals 19rem when the root font size is the browser default of 16px. The calculation is 304 ÷ 16 = 19.

19rem equals 304px at a 16px root font size (19 × 16 = 304).

Yes. If the root font size is 18px, 304px equals 16.8889rem, and at 20px it equals 15.2rem. 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.