frontendhack-logo
128px = 8rem

At the default root font size of 16px, 128px is exactly 8rem.

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

How to convert 128px to rem

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

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

128px at different root font sizes

Root font sizeInputResult
10px128px12.8rem
12px128px10.6667rem
14px128px9.1429rem
15px128px8.5333rem
16px128px8rem
18px128px7.1111rem
20px128px6.4rem
22px128px5.8182rem
24px128px5.3333rem

CSS examples

font-size: 8rem; /* 128px */
padding: 8rem;
margin-bottom: 8rem;
width: 8rem;

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

font-size: 128px;
padding: 128px;

Tailwind CSS equivalent

The default spacing scale has a step for 8rem: use classes like p-32, m-32, gap-32, w-32 and h-32. As a font size, 8rem is the default text-9xl class.

Nearby values

PixelsREM
128px8rem
2px0.125rem
3px0.1875rem
4px0.25rem
5px0.3125rem
6px0.375rem

Frequently Asked Questions

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

8rem equals 128px at a 16px root font size (8 × 16 = 128).

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