TXT · Text & Data tools

PX to REM Converter

Pixels (px) Input
Root Em (rem) Output
Pixels (px)InputRoot Em (rem)Output6Items
Go to full CSS Unit Converter

Convert px to rem

Enter pixel values one per line or paste CSS containing px lengths. The output divides each matching value by 16 and adds the rem unit.

24px becomes 1.5rem, and 32px becomes 2rem.

Root font size

A rem equals the computed font size of the document root. This focused conversion assumes a 16px root, which matches the common browser default when the page does not override it.

Open the full CSS Unit Converter when the project uses another root size.

CSS replacement

Only values carrying the px unit are replaced inside CSS. Unitless numbers, percentages, and values already written as rem remain unchanged.

Frequently Asked Questions

Divide the pixel value by the root font size. With a 16px root, 24px divided by 16 equals 1.5rem.

The focused converter uses a 16px root size. Open the full CSS Unit Converter to set another base value.

Yes. Paste CSS declarations and matching px values are replaced while the rest of each line stays intact.

Focused CSS unit converters

Full CSS Unit Converter tool

Explore Our Tools

Browse all tools