EM to PX converter
Convert em values to pixels against a parent font size you set, so you can see what a nested component actually measures on screen.
- Runs in your browser
- Nothing you enter is sent
- Free, no account
Relative to the font size of the element itself (or its parent, for the font-size property).
A CSS pixel — an absolute unit in CSS terms, independent of the device pixel ratio.
The rem basis. 16 px unless you changed the html font-size.
The em and % basis — the computed font size of the element's parent.
- px
- 256
- rem
- 16
- em
- 16
- pt
- 192
- %
- 1600
px = em × parent font size (16 px) 256 px = 16em × 16 (via 256 px)
| px | rem | em | pt | % |
|---|---|---|---|---|
| 1px | 0.0625rem | 0.0625em | 0.75pt | 6.25% |
| 2px | 0.125rem | 0.125em | 1.5pt | 12.5% |
| 4px | 0.25rem | 0.25em | 3pt | 25% |
| 6px | 0.375rem | 0.375em | 4.5pt | 37.5% |
| 8px | 0.5rem | 0.5em | 6pt | 50% |
| 10px | 0.625rem | 0.625em | 7.5pt | 62.5% |
| 11px | 0.6875rem | 0.6875em | 8.25pt | 68.75% |
| 12px | 0.75rem | 0.75em | 9pt | 75% |
| 13px | 0.8125rem | 0.8125em | 9.75pt | 81.25% |
| 14px | 0.875rem | 0.875em | 10.5pt | 87.5% |
| 15px | 0.9375rem | 0.9375em | 11.25pt | 93.75% |
| 16px | 1rem | 1em | 12pt | 100% |
| 17px | 1.0625rem | 1.0625em | 12.75pt | 106.25% |
| 18px | 1.125rem | 1.125em | 13.5pt | 112.5% |
| 20px | 1.25rem | 1.25em | 15pt | 125% |
| 22px | 1.375rem | 1.375em | 16.5pt | 137.5% |
| 24px | 1.5rem | 1.5em | 18pt | 150% |
| 26px | 1.625rem | 1.625em | 19.5pt | 162.5% |
| 28px | 1.75rem | 1.75em | 21pt | 175% |
| 30px | 1.875rem | 1.875em | 22.5pt | 187.5% |
| 32px | 2rem | 2em | 24pt | 200% |
| 36px | 2.25rem | 2.25em | 27pt | 225% |
| 40px | 2.5rem | 2.5em | 30pt | 250% |
| 44px | 2.75rem | 2.75em | 33pt | 275% |
| 48px | 3rem | 3em | 36pt | 300% |
| 56px | 3.5rem | 3.5em | 42pt | 350% |
| 64px | 4rem | 4em | 48pt | 400% |
| 72px | 4.5rem | 4.5em | 54pt | 450% |
| 80px | 5rem | 5em | 60pt | 500% |
| 96px | 6rem | 6em | 72pt | 600% |
Your CSS never leaves this tab — check it yourself—
Starting the network probe…
The counter above wraps fetch, XMLHttpRequest and navigator.sendBeacon in this tab and counts every call. It does not block anything — it just reports.
Two ways to verify independently
- Turn off Wi-Fi or enable airplane mode, then use the tool. It keeps working, because the page is already fully loaded.
- Open your browser devtools, switch to the Network tab, clear it, and run the tool. No new row appears.
Why this matters
In 2025 researchers found that popular online formatters had retained tens of thousands of user-submitted snippets — JSONFormatter.org and CodeBeautify together exposed roughly 80,000 saved documents, many containing live cloud credentials, private keys and internal database connection strings, because “format this” quietly meant “upload this”. A separate incident exposed roughly 3.5 million user PDFs on a document-conversion service. The only structural fix is not sending the data in the first place: this site is served under a Content-Security-Policy whose connect-src contains no third-party origin, so a request off this device cannot be made even by accident.
The formula depends on the parent
px = em × parent font size
Parent 16px: 1.25em = 20px
Parent 14px: 1.25em = 17.5px
Parent 20px: 1.25em = 25px That is the practical difference from rem: the same em value means different things in different places, so “what is 1.25em?” has no answer without context. Set the parent field above to the real computed size and the number becomes meaningful.
Finding the parent font size
- Open devtools and select the element you care about.
- Switch to the Computed panel — not Styles, which shows the declared value.
- Read
font-size. That is a resolved pixel value after all inheritance. - For a
font-sizedeclared in em, select the parent element and read its computed size instead.
The two-bases problem
One rule can use two different bases at once, and this catches everyone at least once.
/* Parent computes to 16px */
.badge {
font-size: 0.75em; /* 0.75 × 16 = 12px (parent's size) */
padding: 0.5em; /* 0.5 × 12 = 6px (this element's size) */
}
The padding is 6px, not 8px, because font-size resolved first and everything else on
the element then resolves against the result. If a component’s spacing comes out smaller than
you expected, this is almost always why.
Common em values at a 16px parent
| em | px | Where you see it |
|---|---|---|
| 0.5 | 8 | Gap between an icon and its label |
| 0.625 | 10 | Vertical padding on a compact button |
| 0.75 | 12 | Badge and caption text |
| 0.875 | 14 | Secondary text |
| 1 | 16 | Matches the surrounding text — icons, inline spacing |
| 1.25 | 20 | Sub-heading, generous horizontal padding |
| 1.5 | 24 | Heading, or a large spacing step |
| 2 | 32 | Section heading |
em inside a media query
A special case worth knowing: inside @media, em is always relative to the
browser’s initial font size — the default or the user’s chosen size — and never to any
font size you declared. So @media (min-width: 48em) fires at 768px for a default
user, and at 960px for someone whose default is 20px, which is usually exactly the behaviour you
want. Crucially, it is unaffected by a project that sets html { font-size: 62.5% },
which is why em breakpoints are more robust than rem ones in such projects.
Auditing an existing component
Converting a component’s em values to px is a good way to check it is internally consistent. If the padding, gap and radius all land on the same spacing grid at the base size, the component will scale cleanly. If one of them is 6.5px, something was tuned by eye and will look wrong at a different size.
Questions
What is the formula?
px = em × parent font size. At a 16 px parent, 1.25 em is 20 px. At a 14 px parent, the same 1.25 em is 17.5 px — which is exactly why em values cannot be read at a glance the way rem values can.
How do I find the parent font size?
In devtools, select the parent element and read the Computed panel's `font-size`. That is the resolved pixel value after inheritance, which is the number to type into the field above.
Why does my padding measure something unexpected?
Check whether the element sets its own `font-size`. Padding in em uses the element's own computed size, but a `font-size` declared in em on the same element uses the parent's. Two different bases in one rule catches everyone out at least once.
Do media queries accept em?
Yes, and inside a media query em is always relative to the initial font size — the browser default or the user's setting — never to the root element's declared size. That makes em breakpoints behave more predictably than rem ones when a project changes the root size.