PX to REM

Convert px to rem — instantly in your browser, nothing uploaded.

Convert a whole CSS block

CSS with rem values

Sizing in rem instead of px lets your layout scale with the user’s browser font-size setting, which is better for accessibility. This free px-to-rem converter does the maths against your root font size (16px by default) and can also rewrite an entire CSS block at once, replacing every px value with its rem equivalent. It all runs in your browser, so nothing is uploaded, and it works offline once loaded.

Frequently Asked Questions

How do I convert px to rem?

Type a value into the box above and the converted result appears immediately, using the root font size you set (16px is the browser default). To convert many values at once, paste a whole CSS block into the second box and every px value is rewritten to rem automatically.

What is the formula?

rem = px ÷ root font size. With the default 16px root, 24px becomes 1.5rem. If your project sets a different root font size, change the base field and everything recalculates.

Why use rem?

rem scales with the user’s chosen browser font size, so text and spacing grow for people who need larger type — an accessibility win that fixed px sizes prevent.

Does it change 0 values or values inside other units?

Zero stays as plain 0 (no unit needed), and only px values are touched — percentages, viewport units and other lengths are left exactly as they are. Your CSS structure, comments and formatting are preserved.

Is it free and private?

Yes. It is completely free with no signup, and the conversion is simple arithmetic done in your browser — nothing is uploaded and it works offline once the page has loaded.