Convert CSS units between px, rem, and em at any root font size, in both directions. Includes a quick-reference table of common pixel values — exact math, computed live in your browser.
How to use CSS px ↔ rem/em Converter
Set your root font size (default 16px).
Enter a value and pick its unit to see the equivalents.
Copy any result, or grab values from the reference table.
Frequently asked questions
What root font size should I use?
Most browsers default to 16px, so 1rem = 16px. Change the root value if your project sets a different base font size on the html element.
What is the difference between rem and em?
rem is always relative to the root font size, while em is relative to the current element’s font size. This tool converts both against the root value you choose.