Convert pixels to rem and em with a custom root font size.
Bar: size relative to 80 px.
1116| PX | REM | EM (parent = root) | Size |
|---|---|---|---|
| 8 | 0.5 | 0.5 | 8 px |
| 10 | 0.625 | 0.625 | 10 px |
| 12 | 0.75 | 0.75 | 12 px |
| 14 | 0.875 | 0.875 | 14 px |
| 16 | 1 | 1 | 16 px |
| 18 | 1.125 | 1.125 | 18 px |
| 20 | 1.25 | 1.25 | 20 px |
| 24 | 1.5 | 1.5 | 24 px |
| 28 | 1.75 | 1.75 | 28 px |
| 32 | 2 | 2 | 32 px |
| 40 | 2.5 | 2.5 | 40 px |
| 48 | 3 | 3 | 48 px |
| 56 | 3.5 | 3.5 | 56 px |
| 64 | 4 | 4 | 64 px |
| 80 | 5 | 5 | 80 px |
🔒 100% client-side — all conversions compute locally. rem = px ÷ root-font-size.
The PX to REM / EM Converter is based on the following formula:
rem = px / root font size (px)
Variables: px: length in pixels (px) root font size: font size of the html element, default 16 px rem: length in rem units
Convert pixels to rem relative to the root font size (default 16 px). rem scales with user font settings, so it is the accessible unit for type and spacing.
Worked example: Step 1: Convert 24 px with the default 16 px root font size. Step 2: rem = 24 / 16 = 1.5. Result: 24 px = 1.5 rem.
Modern CSS uses rem and em instead of pixels so layouts scale with the user's font-size preference. But converting px to rem in your head is error-prone — you have to divide by the root font size, which isn't always exactly 16px. This tool does the math instantly and shows a live table for the sizes you use every day.
rem (root em) is always relative to the <html> element's font size, so it is predictable and consistent everywhere — ideal for layout, spacing, and base font sizes. em is relative to the nearest parent element's font size, so it compounds in nested elements. Use em for padding and margins inside components that should scale with their own text (e.g. a button whose padding grows with its label). For everything else, prefer rem.
Many teams set html { font-size: 62.5% } so the root becomes 10px and 1rem = 10px — making mental math trivial (1.6rem = 16px). If your project does this, change the root size here to 10px so the conversions match. Otherwise, leave it at 16px (the browser default). Always verify against the computed style on the html element in DevTools.
Some contexts (design specs, Figma exports, browser DevTools) speak in pixels. Converting those px values to rem keeps your stylesheet scalable while matching the designer's intent. This tool's table covers the common sizes (8, 12, 16, 20, 24, 32, 40, 48…) so you can copy the right value without reaching for a calculator.
More tools you might find useful
Strip comments, metadata, and whitespace from SVG files.
Convert WebP images to PNG or JPG in your browser.
Convert SVG to PNG or WebP in-browser with custom scale and download.
Compute missing width or height to keep any aspect ratio.