Developer · CSS

PX to REM converter.

Convert px, rem and em in either direction. Change the root font size if your project sets one. Runs in your browser; nothing is sent or stored.

Formula: rem = px ÷ root font size. With the common 16px default, 16px = 1rem, 24px = 1.5rem and 10px = 0.625rem.

Sources: MDN CSS <length> and font-sizeVerified 1 October 2026

Advertisement

Convert

Edit either box; the other updates.
Root size for rem; parent element size for em. Browser default is commonly 16px.

Result

Enter a value.

How px, rem and em relate

A rem equals the font size of the root element (typically <html>). MDN notes that a common browser default is 16px but user preferences may change it. An em is relative to the parent element’s font size, so nested em values compound; use the base-size box as the parent size for em.

Worked example: 24px ÷ 16 = 1.5rem. With a 10px root, 24px = 2.4rem; with a 20px root, 24px = 1.2rem.

Common sizes at the base size above

Computed as px ÷ base size, rounded to 4 decimals
pxrem

Accessibility

MDN states that defining font sizes in px is not accessible, because users cannot change the font size in some browsers, and that sizes relative to the user’s default font size are generally best. Absolute lengths do not scale with user settings. Setting the root size to a percentage or leaving it at the default keeps rem values respecting the reader’s preference. For fluid sizes between two bounds, see the CSS clamp calculator.

FAQ

How do I convert px to rem? Divide px by the root font size: 24 ÷ 16 = 1.5rem.

rem or em? rem tracks the root, em tracks the parent and compounds when nested; rem is easier to reason about for global scales.

Why does my result differ? If your stylesheet or the user changes the root font size, rem no longer equals 16px. Enter your actual base size above.

Sources (as of 1 October 2026)

Privacy

This tool runs entirely in your browser. Nothing you type is transmitted, stored or logged.

Advertisement
Advertisement
Listening…