px to rem
Convert CSS pixel values to rem and browse a reference table
About px to rem
Converts CSS pixel values to rem and rem back to px, using a root font size you can change (16px by default) and rounding results to four decimal places. A reference table lists 21 common sizes from 4px to 128px and recalculates whenever you change the base. Useful when turning pixel values from a design mockup into scalable rem-based typography and spacing.
Category: Converters.
Frequently asked questions
What is the difference between px and rem?
▾
px is an absolute unit — 16px is always 16px. rem (root em) is relative to the root font size (typically 16px). 1rem = 16px by default, 1.5rem = 24px. Browser zoom scales both units, but only rem follows the user's default font size setting.
Why use rem instead of px?
▾
rem respects the user's browser font size setting. Users who set their browser to a larger font size for accessibility will benefit from rem-based layouts. px values stay fixed regardless.
What if my root font size is not 16px?
▾
Enter your custom root font size in the tool. Many design systems set html { font-size: 62.5% } (10px) so that 1rem = 10px for easier mental math.
Can it calculate em values too?
▾
Yes, with one adjustment. em is relative to the parent element's font size rather than the root, so enter the parent's font size as the base and read the rem result as em.