frontendhack-logo
338px = 21.125rem

At the default root font size of 16px, 338px is exactly 21.125rem.

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

How to convert 338px to rem

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

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

338px at different root font sizes

Root font sizeInputResult
10px338px33.8rem
12px338px28.1667rem
14px338px24.1429rem
15px338px22.5333rem
16px338px21.125rem
18px338px18.7778rem
20px338px16.9rem
22px338px15.3636rem
24px338px14.0833rem

CSS examples

font-size: 21.125rem; /* 338px */
padding: 21.125rem;
margin-bottom: 21.125rem;
width: 21.125rem;

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

font-size: 338px;
padding: 338px;

Tailwind CSS equivalent

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

Nearby values

PixelsREM
338px21.125rem
2px0.125rem
3px0.1875rem
4px0.25rem
5px0.3125rem
6px0.375rem

Frequently Asked Questions

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

21.125rem equals 338px at a 16px root font size (21.125 × 16 = 338).

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