🎨 CSS Unit Converter

PX to REM Converter

Convert pixels (px) to rem and rem to pixels side by side. Change the root font size, convert multiple pixel values, and copy results for your CSS stylesheet.

🔒 All calculations run locally in your browser.
px
The common browser default is 16px.
Result in rem
1.5rem
Result in pixels
24px

Convert multiple px values to rem

Enter pixel values separated by commas, spaces, or new lines. Results use the root font size above.

PixelsREM
Converting sample values…

Choose px or rem for the job

Use this converter when you need to translate existing pixel measurements into rem values, or when a design specification gives rem values and you need the equivalent pixels. The key setting is the root font size: at 16px, 1rem equals 16px; at 20px, 1rem equals 20px. Always use the root size your project actually uses instead of assuming the default.

When rem is useful

Rem values are often useful for text sizes and spacing that should scale with the document's root font size. Pixels can still be appropriate when a design calls for a fixed-size detail, such as a thin border. Converting a number does not decide which unit is best; that depends on the design and accessibility requirements.

If you are converting a full stylesheet, check the root font-size rule and test the page at different browser text settings. A mathematically correct conversion can still change the layout if the original project uses a different root size or relies on pixel-specific behaviour.