frontendhack-logo
0.4rem = 6.4px

At the default root font size of 16px, 0.4rem is exactly 6.4px.

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

How to convert 0.4rem to px

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

6.4px is a very small size, typically used for borders, hairlines, icon gaps and fine detail.

0.4rem at different root font sizes

Root font sizeInputResult
10px0.4rem4px
12px0.4rem4.8px
14px0.4rem5.6px
15px0.4rem6px
16px0.4rem6.4px
18px0.4rem7.2px
20px0.4rem8px
22px0.4rem8.8px
24px0.4rem9.6px

CSS examples

font-size: 0.4rem; /* 6.4px */
padding: 0.4rem;
margin-bottom: 0.4rem;
width: 0.4rem;

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

font-size: 6.4px;
padding: 6.4px;

Tailwind CSS equivalent

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

Nearby values

REMPixels
0.2rem3.2px
0.25rem4px
0.3rem4.8px
0.3125rem5px
0.375rem6px
0.4rem6.4px
0.4375rem7px
0.5rem8px
0.5625rem9px
0.6rem9.6px
0.625rem10px

Frequently Asked Questions

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

6.4px equals 0.4rem at a 16px root font size (6.4 ÷ 16 = 0.4).

Yes. rem is relative to the root font size, so 0.4rem becomes 7.2px at an 18px root and 8px 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.