Loading...
4 pixels converts to 0.25em when the parent element's font-size is 16px. Unlike REM (which is relative to the root), EM is relative to the parent element's font-size. If the parent font-size differs from 16px, the em value changes.
Formula
4px ÷ 16 = 0.25em
/* 4px as em (parent font-size: 16px) */
.parent {
font-size: 16px;
}
.child {
font-size: 0.25em; /* 4px */
}EM is relative to the parent element's font-size, while REM is relative to the root (html) font-size. Use EM for component-internal sizing and REM for global consistency. 4px = 0.25em (parent 16px) = 0.25rem (root 16px).
A value of 4px (0.25em) is commonly used for fine details, small borders, and micro spacing relative to the parent element. EM units are ideal for component-level sizing where elements should scale relative to their parent, not the root.
| px | em |
|---|---|
| 8 | 0.5 |
| 10 | 0.625 |
| 12 | 0.75 |
| 14 | 0.875 |
| 16 | 1 |
| 18 | 1.125 |
| 20 | 1.25 |
| 24 | 1.5 |
| 32 | 2 |
| 48 | 3 |
Convert any value instantly with our free PX to EM Converter.
Open PX to EM Converter →