Free online tools

PX to REM Converter

Convert CSS pixel lengths and rem values using your project’s root font size. Paste a list to convert spacing, font sizes or other design tokens together.

Enter your values

Separate values with spaces, commas or new lines. The decimal mark is a period.

This tool processes your input in your browser.

Result

Use the root element’s font size

One rem equals the computed font size of the root element. Divide pixels by that size to get rem, or multiply rem by that size to get pixels. At a 16 px root, 24 px is 1.5 rem.

Convert multiple CSS values for your project

Use the root size your page actually uses. Negative values are accepted for settings where CSS allows them, such as a negative margin. Output values are rounded to at most six decimal places for copy and paste.

Frequently asked questions

Are CSS pixels the same as device pixels?

A CSS pixel is a layout unit. The display can use more than one physical pixel per CSS pixel, depending on device pixel ratio and zoom.

Can I enter em or percent values?

This tool converts CSS px and rem. An em value may depend on the font size of another element, so it needs different context.