UTILS.
Private by default
px

CSS Unit Converter

Convert a CSS length between px, rem, em, pt, pc, in and cm.

Your files stay on this device

Files are processed in your browser, never uploaded. The site downloads code and assets to run the tools. No accounts or trackers.

Use Download to save this tool as one HTML file for offline use.

Privacy →

About this tool

Convert CSS length units using px as the base and a configurable root font-size, all in your browser.

Enter a value, pick its unit and set the root font-size in pixels. All seven units are shown at once: px, rem, em, pt, pc, in and cm. Results update as you type, are rounded to six decimal places, and clicking one copies its number without the unit.

rem and em are treated identically, both equal to the root size, so the tool cannot model an em inside a parent with a different font-size. The root defaults to 16 and must be above zero. A blank value, a non-number or an invalid root shows an error and hides the results. Negative values convert normally.

Frequently asked questions

How are rem and em calculated?
Both are taken relative to the root font-size you set (default 16px), so 1rem and 1em equal that many pixels here.
What pixel ratios are used?
CSS reference units: 1in = 96px, 1pc = 16px, 1pt = 96/72px and 1cm = 96/2.54px.
Which units depend on the root font-size?
Only rem and em. The others use fixed ratios.
How do I convert 1.5rem to px?
Enter 1.5, choose rem and keep the root at 16. The px result shows 24.

More tools