At the default root font size of 16px, 0.25rem is exactly 4px.
Calculation based on a root font-size of 16 pixels.
How to convert 0.25rem to px
To convert rem to pixels, multiply the rem value by the root font size: px = rem × 16. For 0.25rem that is 0.25 × 16 = 4px.
4px is a very small size, typically used for borders, hairlines, icon gaps and fine detail. It is often used for the smallest step of a 4px spacing grid.
0.25rem at different root font sizes
| Root font size | Input | Result |
|---|---|---|
| 10px | 0.25rem | 2.5px |
| 12px | 0.25rem | 3px |
| 14px | 0.25rem | 3.5px |
| 15px | 0.25rem | 3.75px |
| 16px | 0.25rem | 4px |
| 18px | 0.25rem | 4.5px |
| 20px | 0.25rem | 5px |
| 22px | 0.25rem | 5.5px |
| 24px | 0.25rem | 6px |
CSS examples
font-size: 0.25rem; /* 4px */
padding: 0.25rem;
margin-bottom: 0.25rem;
width: 0.25rem;The same values in pixels, if you need a fixed size:
font-size: 4px;
padding: 4px;Tailwind CSS equivalent
The default spacing scale has a step for 0.25rem: use classes like p-1, m-1, gap-1, w-1 and h-1.
Nearby values
Frequently Asked Questions
0.25rem equals 4px when the root font size is the browser default of 16px. The calculation is 0.25 × 16 = 4.
4px equals 0.25rem at a 16px root font size (4 ÷ 16 = 0.25).
Yes. rem is relative to the root font size, so 0.25rem becomes 4.5px at an 18px root and 5px 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.
