What are px, rem and em?
A pixel (px) is a fixed CSS unit. A rem is relative to the root font size of the page, which is 16 px by default, so 1 rem is 16 px and 24 px is 1.5 rem. An em is relative to the font size of the parent element, so it can change from one place to the next.
Other units include points (pt), where 1 pt is 1.333 px in CSS, and vw and vh, which are 1 percent of the viewport width and height. This tool converts between all of them. You set the root size, the parent size and the viewport, so the numbers match your design.
How to use the PX to REM Converter
- Enter the value and choose the unit you are converting from.
- Set the root font size, parent font size and viewport if yours differ.
- Read all the converted values.
- Copy the one you need.