At the default root font size of 16px, 6px is exactly 0.375rem.
Calculation based on a root font-size of 16 pixels.
How to convert 6px to rem
To convert pixels to rem, divide the pixel value by the root font size: rem = px ÷ 16. For 6px that is 6 ÷ 16 = 0.375rem.
6px is a very small size, typically used for borders, hairlines, icon gaps and fine detail.
6px at different root font sizes
| Root font size | Input | Result |
|---|---|---|
| 10px | 6px | 0.6rem |
| 12px | 6px | 0.5rem |
| 14px | 6px | 0.4286rem |
| 15px | 6px | 0.4rem |
| 16px | 6px | 0.375rem |
| 18px | 6px | 0.3333rem |
| 20px | 6px | 0.3rem |
| 22px | 6px | 0.2727rem |
| 24px | 6px | 0.25rem |
CSS examples
font-size: 0.375rem; /* 6px */
padding: 0.375rem;
margin-bottom: 0.375rem;
width: 0.375rem;The same values in pixels, if you need a fixed size:
font-size: 6px;
padding: 6px;Tailwind CSS equivalent
The default spacing scale has a step for 0.375rem: use classes like p-1.5, m-1.5, gap-1.5, w-1.5 and h-1.5.
Nearby values
Frequently Asked Questions
6px equals 0.375rem when the root font size is the browser default of 16px. The calculation is 6 ÷ 16 = 0.375.
0.375rem equals 6px at a 16px root font size (0.375 × 16 = 6).
Yes. If the root font size is 18px, 6px equals 0.3333rem, and at 20px it equals 0.3rem. 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.
