PX to REM Converter
Enter a pixel value and a base font size to see rem, em, pt and percent side by side. The table lists common sizes, and the CSS mode rewrites px values in a stylesheet. Everything is calculated in your browser.
PX to REM Converter runs entirely in your browser: the text you paste is never sent to a server. It is free and needs no sign-up.
How to use it
- Enter a value and a base size Type the value and choose its unit: px, rem, em, pt or %. The base font size is 16 px by default. Change it to match the root font size of your site.
- Read the results or the size table The single-value view shows the result in px, rem, em, pt and %, each with its own Copy button. The size table lists 13 common sizes from 8 to 64 px and updates when the base changes.
- Convert a whole stylesheet In Convert CSS, paste your styles, choose a direction and decide whether to keep values of 1px or less. The tool shows how many values it changed, and you can copy the result or download converted.css.
Questions
Why does the rem value depend on the base size?
A rem equals the root font size, which browsers set to 16 px by default. So 24 px is 1.5 rem with a base of 16, but 2.4 rem with a base of 10. The tool treats em the same way, so an em result is exact only when the element’s font size equals the base.
What does Convert CSS change and what does it skip?
It changes only numbers that end in px. It skips text in quotes, comments and url() values, so a file name such as a16px.png stays as written. Values with an absolute size of 1px or less stay unchanged while the option is ticked, and 0px is never changed.