PX to REM converter
Convert a length between px, rem, em and pt for the root and parent font sizes you set. Paste a CSS rule and the px lengths become rem.
- px, rem, em, pt
- Free, no sign-up
Runs in your browser. Nothing you type or open is uploaded. Free to use, no account. More code and data tools
How to use it
- Set the root font size, and the parent size when em matters.
- Type a length in px, rem, em or pt and read the other three.
- Paste CSS to turn px lengths into rem.
Root, parent, and a point
One rem is the root font size. One em is the parent font size. The page starts at 16px for both, so 16px is 1rem, 1em and 12pt. A point is 96/72 of a pixel, the CSS definition, so 12pt is 16px.
The CSS box finds each px length and divides it by the root size. With the 1px option on, a border of 1px stays 1px while 32px becomes 2rem. The lengths you type can travel in the page link. The CSS you paste stays in this tab.
Private by design
Privacy
Everything runs in this page and stays on your device. Text you paste stays in this tab. Choices such as a format or a font size can be shared in the page link.
This page also shows Google ads, which can use cookies. Privacy and cookies explains how.
Questions
What is 1rem?
One rem equals the root font size. At a 16px root, 1rem is 16px and 32px is 2rem.
How is em different from rem?
Rem uses the root font size. Em uses the parent font size, which has its own box.
How many pixels is a point?
One point is 96/72 pixels. At a 16px root, 12pt is 16px and 1rem.
Can a 1px border stay 1px?
Yes. Leave the 1px option on and a length of exactly 1px stays 1px. Other px lengths become rem.