frontendhack-logo
0.5rem = 8px

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

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

How to convert 0.5rem to px

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

8px is a small size, common for captions, labels, small text and tight spacing. It is often used for the core unit of the popular 8-point spacing system.

0.5rem at different root font sizes

Root font sizeInputResult
10px0.5rem5px
12px0.5rem6px
14px0.5rem7px
15px0.5rem7.5px
16px0.5rem8px
18px0.5rem9px
20px0.5rem10px
22px0.5rem11px
24px0.5rem12px

CSS examples

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

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

font-size: 8px;
padding: 8px;

Tailwind CSS equivalent

The default spacing scale has a step for 0.5rem: use classes like p-2, m-2, gap-2, w-2 and h-2.

Nearby values

REMPixels
0.3rem4.8px
0.3125rem5px
0.375rem6px
0.4rem6.4px
0.4375rem7px
0.5rem8px
0.5625rem9px
0.6rem9.6px
0.625rem10px
0.6875rem11px
0.7rem11.2px

Frequently Asked Questions

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

8px equals 0.5rem at a 16px root font size (8 ÷ 16 = 0.5).

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