CSS px ↔ rem/em Converter
Convert CSS units between px, rem, and em at any root font size, in both directions. Common conversions include px to rem, rem to px, px to em, and em to px. 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
- How do I convert px to rem?
- Enter your pixel value with the unit set to px and read the rem result. At the default 16px root, 16px equals 1rem, so the tool divides your value by the root size.
- How do I convert rem to px?
- Set the unit to rem and type your value; the tool multiplies by the root font size (16px by default) to give the pixel equivalent.
- 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.