PX to REM Converter
Convert between px, rem and em for CSS using your root font size.
| px | 24px | |
| rem | 1.5rem | |
| em | 1.5em |
Converts between px, rem and em using your root font size (16px by default). 1rem = the root font size, so 24px = 1.5rem at a 16px base. em is shown relative to the same base β in practice em compounds with the parent's font size. Runs in your browser.
Convert CSS units between px, rem and em using your root font size (16px by default). Enter a value in any unit and get the other two β 24px is 1.5rem at a 16px base. rem is relative to the root font size, which makes layouts scale cleanly with user settings. Runs in your browser.
How to use the PX to REM Converter
- Enter a value and pick its unit (px, rem or em).
- Set your base (root) font size if it isn't 16px.
- Copy the px, rem or em value you need.
Frequently asked questions
How do you convert px to rem?
Divide the pixel value by the root font size. At the default 16px base, 24px Γ· 16 = 1.5rem.
What's the difference between rem and em?
rem is always relative to the root (html) font size, while em is relative to the font size of the current element's parent, so em can compound through nesting. This tool shows em against the same base for reference.
Why use rem instead of px?
rem scales with the user's chosen root font size, so text and spacing respect accessibility settings β better for responsive, accessible layouts.