PX to REM / EM Converter.
Convert px, rem, em, pt and % with your root font size, or rewrite every px in a CSS block as rem.
Runs in your browserAbout PX to REM / EM Converter
PX to REM / EM Converter turns design measurements into the relative units that make a layout respect the user's font settings. With the default root font size of 16px, 24px becomes 1.5rem, 14px becomes 0.875rem and 12pt becomes 16px. Each value in the list gets a row with its pixel, rem, em, point and percent equivalents, so you can check a whole type scale at once. Values without a unit are read as pixels. Rem is always relative to the root element, while em and percent are relative to the parent element's font size, which is why the parent size is a separate setting: inside a 20px card heading, 1em is 20px, not 16px. Switch to CSS mode and paste a stylesheet to rewrite every px length as rem in one go; 0px becomes 0, and names like icon-16px.png are left alone because only standalone numbers followed by px are changed. A common mistake is setting html { font-size: 62.5% } to make 1rem equal 10px and then forgetting to enter 10 as the root size here, which makes every result off by a factor of 1.6. Another is converting 1px borders and hairlines to rem; they are usually meant to stay one device pixel, so review the converted CSS before committing it. Points use the CSS definition of 96px per 72pt. The precision setting controls rounding, and four decimal places is enough for any browser. All conversions run locally in your browser.
How to Use
- Enter lengths such as 16px 1.5rem 12pt, or switch to CSS mode and paste a stylesheet.
- Set the root font size (and the parent size for em and %).
- Copy the table or the converted CSS.
Frequently Asked Questions
What is the difference between rem and em?
Rem is relative to the root html element's font size. Em is relative to the font size of the element's parent, so nested em values compound while rem values do not.
Why use rem instead of px?
When users raise the default font size in their browser, rem-based sizes scale with it. Pixel sizes stay fixed, which can make text hard to read.
Does CSS mode change 1px borders?
Yes, every standalone px length is converted. Review hairline borders and box shadows afterwards if you want them to stay in pixels.
Is my CSS uploaded?
No. The conversion runs in your browser and the page makes no network requests while you use it.
Related Tools
Convert between HEX, RGB, and HSL formats.
Simplify width × height to a ratio, resize while keeping proportions and get the CSS aspect-ratio value.
Convert between bytes, KB, MB, GB, TB, PB.
Convert numbers between bases (2–36).
Convert between Unix timestamps and dates.
Parse cron expressions and preview next run times.