How to use
- 1Enter the root font size (browsers default to 16 px).
- 2For em, enter the parent element’s font size, or leave it equal to the root size.
- 3Type a value in px, rem or em; the others update instantly.
- 4Copy the ready CSS declaration or click a common size in the table.
How to convert px to rem
According to W3C CSS Values and Units Level 4, 1rem equals the computed font size of the root element (html). So rem = px ÷ root font size. With a 16 px root, 24 px = 24 ÷ 16 = 1.5rem, 14 px = 0.875rem and 10 px = 0.625rem. The other way round, px = rem × root size: 1.25rem = 20 px. With a 10 px root, 18 px = 1.8rem.
rem vs em
rem is always relative to the root element’s font size; em is relative to the element’s own font size — or, inside the font-size property, to the parent’s. Nested em values compound (1.2em inside 1.2em = 1.44×), while rem stays constant. That is why rem keeps typography and spacing consistent, while em suits padding that should scale with a component. The converter has a separate parent size for em.
Why use rem?
When a user raises the default text size in browser settings, sizes in rem scale with it, while px values ignore that preference — an accessibility win for rem. The 16 px figure is not fixed by the spec: CSS Fonts Level 4 defines “medium” as the user’s preferred font size, which current browsers set to 16 px by default. CSS also defines 1in = 96px = 72pt, so the tool shows the pt equivalent too (1px = 0.75pt).
Frequently asked questions
How many rem is 16px?
With a 16 px root font size, 16 px = 1rem. Likewise 12 px = 0.75rem, 18 px = 1.125rem and 32 px = 2rem.
What does html { font-size: 62.5% } do?
It lowers the default 16 px to 10 px (16 × 0.625), so 1.8rem = 18 px and maths gets easier. If you use it, set the root size here to 10.
Should media queries use rem or em?
In media queries both rem and em resolve against the initial font size, not the html font-size you set in CSS, so 16 px-based em or rem breakpoints behave the same.
Is rem supported by all browsers?
Yes. rem has been supported by every major browser for many years and is part of the CSS Values and Units standard.
Add this tool to your website
Paste the code below into your site’s HTML; the tool runs on your page and stays up to date automatically.
Not happy with the results?
Talk to Webin Agency about fast, SEO-friendly websites, e-commerce and Google Ads management.