About the PX to REM Converter
Build accessible CSS that scales with the user’s font settings by writing sizes in rem instead of fixed pixels.
Pixels are fixed, but rem units scale with the root font size of the page. When a visitor increases their browser’s default text size for easier reading, everything written in rem grows with it, while pixel-based layouts stay small. That is why modern CSS frameworks such as Tailwind use rem for font sizes and spacing.
The conversion is a simple division: rem = px ÷ root font size. With the default 16 px root, 24 px is 1.5 rem, 14 px is 0.875 rem and 32 px is 2 rem. If your stylesheet sets html { font-size: 62.5% }, the root becomes 10 px and the maths is even easier: 24 px is 2.4 rem. Set the root size in the first box and both directions update instantly.
The tool also shows the same size in points (1 px = 0.75 pt, because CSS defines 96 px and 72 pt per inch), which is useful for print stylesheets and design hand-offs, and as a percentage of the root. A reference table lists the common sizes from 10 to 96 pixels.
For em units the calculation is the same, but the base is the parent element’s font size instead of the root, so nested em values multiply.
How to use the PX to REM Converter
- 1Set the root font size (16 px by default).
- 2Type pixels or rem; the other updates.
- 3Copy rem, px, pt or % values, or use the reference table.
Key features
- px ↔ rem with any root size.
- pt and % equivalents.
- Copy buttons for each value.
- Reference table of common sizes.
Practical uses
- Turning a designer’s px values into rem.
- Setting up a type scale.
- Writing print styles in pt.
Tips and common mistakes
- Leave the root at 100% (16 px) to respect user settings.
- Use rem for font sizes and spacing, px for hairline borders.
- Round to 3–4 decimals.
Limitations
- Viewport units (vw, vh) are not converted.
Privacy
Runs entirely in your browser.
Frequently asked questions
Why use rem instead of px?
rem sizes scale when a visitor increases the browser’s default font size, which helps accessibility.
What is the difference between rem and em?
rem is relative to the root (html) font size; em is relative to the parent element’s font size, so it compounds when nested.
How do I convert px to pt?
1 CSS px = 0.75 pt, because CSS defines 96 px and 72 pt per inch.
Does Tailwind use rem?
Yes, Tailwind’s spacing and font sizes are in rem, with 1 unit = 0.25 rem = 4 px at a 16 px root.