PX to REM / EM Converter
Convert CSS pixels into rem and em units with configurable font sizes. Copy the result straight into your stylesheet.
Conversion settings
Enter a pixel value and set the font sizes used for conversion.
Pixels to REM
Pixel value divided by root font size.
Pixels to EM
Pixel value divided by parent font size.
Reverse conversion
The original pixel value, shown for reference.
Common pixel conversions
This table updates using your selected root and parent font sizes.
| Pixels | REM | EM | Action |
|---|
When should you use rem or em?
REM is relative to the root element's font size, normally the document's html font size. It is useful for consistent spacing and typography across a site.
EM is relative to the applicable font size of the element's parent context. Nested elements can therefore inherit different effective sizes.
Remember: this tool performs mathematical conversions. The actual rendered size can depend on your CSS inheritance, browser settings, and styles.