PX to REM Converter
Convert pixels to rem and back.
What would you like to do next?
Convert CSS pixels to rem and back
This converter turns pixel values into rem units and rem back into pixels, scaling everything against the root font size you set, sixteen pixels by default. Working in rem keeps a layout proportional and respects the reader's own browser text-size setting, which is why it is the modern choice for typography and spacing in CSS, but the maths of dividing by the base size is easy to get wrong by hand. Change the base, the pixels or the rem and the other figure updates instantly, and a reference table shows the common sizes at a glance so you can convert without reaching for a calculator. It is the same relationship as em when measured against a sixteen-pixel parent.
px, rem and em
A rem is always relative to the root element, while em is relative to its own parent. The conversion here applies directly to rem and to em wherever the parent matches the base size.
Frequently asked questions
What is the default root font size?
Browsers default the root to 16px, so 16px equals 1rem unless a site overrides it. You can change the base here to match your own CSS.
Should I use px or rem in CSS?
rem is generally preferred for font sizes and spacing because it scales with the user's text-size preference, improving accessibility, while px is fine for fixed details like borders.
Is rem the same as em?
Not quite. rem is relative to the root element; em is relative to the current element's parent. They give the same number only when the parent equals the root size.