frontendhack-logo
12px = 0.75rem

At the default root font size of 16px, 12px is exactly 0.75rem.

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

How to convert 12px to rem

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

12px is a small size, common for captions, labels, small text and tight spacing. It is often used for small captions and labels.

12px at different root font sizes

Root font sizeInputResult
10px12px1.2rem
12px12px1rem
14px12px0.8571rem
15px12px0.8rem
16px12px0.75rem
18px12px0.6667rem
20px12px0.6rem
22px12px0.5455rem
24px12px0.5rem

CSS examples

font-size: 0.75rem; /* 12px */
padding: 0.75rem;
margin-bottom: 0.75rem;
width: 0.75rem;

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

font-size: 12px;
padding: 12px;

Tailwind CSS equivalent

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

Nearby values

PixelsREM
12px0.75rem
2px0.125rem
3px0.1875rem
4px0.25rem
5px0.3125rem
6px0.375rem

Frequently Asked Questions

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

0.75rem equals 12px at a 16px root font size (0.75 × 16 = 12).

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