Skip to content
Jellykit

PX to REM and EM Converter

Convert pixels to rem and em and back for any root and parent font size, one value at a time or a whole pasted list in a table.

  • Runs on your device
Loading tool

About PX to REM and EM Converter

Type a size in px, rem or em and see it in the other two units at once. Set the root font size (what 1rem is) and the parent font size (what 1em is) if your stylesheet changes them from the usual 16px.

Paste a list of values to convert them all in a table, for example every spacing value in a design file. A value can carry its own unit, so a list may mix 24, 1.5rem and 12px.

How it works

  1. Every value is first turned into pixels: rem times the root font size, or em times the parent font size.
  2. The pixel value is then divided by the root size for rem and by the parent size for em.
  3. Results are rounded to four decimal places, and a list can hold up to 500 values.

Questions

What is the difference between rem and em?

A rem is the font size of the root (html) element, so it is the same everywhere on the page. An em is the font size of the current context, so it compounds when elements are nested.

Why does everyone assume 16px?

Every major browser sets the default font size to 16px. Readers can change that default, which is the point of rem: sizes in rem follow their choice, while px stay fixed.

Which size should I put as the parent font size?

For font-size, the parent element’s font size. For anything else, such as padding or margin, em refers to the element’s own font size, so enter that instead.

Everything you enter here is processed in this browser tab. Nothing is uploaded, logged or shared. How privacy works here.