PX to REM & EM Converter

Convert between px, rem and em for any base font size and see all three equivalents instantly — runs 100% in your browser with no upload.

Equivalents

rem is measured against the base (root) size, em against the parent element’s size.

16px
1rem
1em

🔒 Converted in your browser — nothing is uploaded.

What this px to rem converter does

Enter a value in pixels or in rem, set your base (root) font size, and this tool shows the equivalent px, rem and em values instantly. The two inputs are linked both ways: type a pixel value to see its rem, or type a rem value to see its pixels. The base font size defaults to 16px, the browser default, but you can change it to match your own root styles. Copy any equivalent with a single click and paste it straight into your CSS.

How the conversion works

The math is simple and lossless: rem = px / base and px = rem × base. With the standard 16px base, 24px equals 1.5rem and 1rem equals 16px. The em figure is measured against the separate parent font size you enter, so it matches the rem figure only when the parent is the root: 24px is 1.5rem on a 16px base, but 1.2em inside a 20px parent. Results are rounded to five decimal places so long fractions stay readable without losing practical accuracy for layout work.

Frequently asked questions

What base font size should I use?

Most browsers use 16px as the default root font size, so 16 is the safe starting point and the tool's default. If your CSS sets a different root size (for example html { font-size: 62.5% } which makes 1rem = 10px), enter that pixel value as the base so the conversions match your project.

What is the difference between rem and em here?

rem is always relative to the root font size, while em is relative to the font size of the element's parent. This tool has a field for each — the base (root) size and the parent size — so the two figures differ whenever the parent is not the root: 24px is 1.5rem on a 16px base and 1.2em inside a 20px parent. Set the parent to the base and they match again.

Is anything I type uploaded to a server?

No. Every calculation runs locally in your browser with JavaScript. The values you enter and the results are never sent, stored or uploaded anywhere.