Convert between px, rem, em, pt, pc, in, cm, mm and Q using the root and element font sizes you actually use rather than an assumed 16px default.
24px is 24px
At the browser default of 16px for both the root and the element, so rem and em agree.
rem is always relative to the document root. em is relative to the element's own font size for most properties, and to its parent's for font-size itself. Neither can be converted without saying which size you mean, which is why both are controls here rather than assumed to be 16.
The absolute units are fixed against the CSS inch, which the specification defines as exactly 96px regardless of the real display. So 1in on screen is not an inch — it is a unit named after one.
vw, vh, vmin, vmax, svh, lvh, dvh and ch, ex and % all depend on something the page knows and this tool does not — the viewport size, the font's own metrics, or the containing block. Offering a number for them would mean inventing one.
CSS Unit Converter runs entirely on your device — nothing is uploaded.
You’re on the Free plan. Compare plans
Every px-to-rem conversion on the web assumes a 16px root, and that assumption is wrong on any site that set `html { font-size: 62.5% }` to make the maths easier, and wrong for every visitor who has enlarged their default text size in their browser settings. Here the root size is an input, so the conversion matches your stylesheet rather than a convention.
`rem` and `em` are not interchangeable and the difference is the whole reason both exist. A `rem` resolves against the document root, so it means the same thing everywhere. An `em` resolves against the font size of the element it is written on, so an `em` padding inside a component scales with that component's text — which is useful on purpose, and compounds unpleasantly when `em` font sizes nest.
The absolute units — pt, pc, in, cm, mm and Q — are fixed ratios to the CSS pixel and nothing to do with your screen. A CSS inch is exactly 96px by definition, whatever your display's real density is. They are for print stylesheets, where that mapping is honoured, and are misleading anywhere else.
Viewport and percentage units are deliberately absent. A `vw` depends on the viewport at the moment of rendering and a percentage depends on the parent element, so neither has a single correct conversion to px — only one that holds for one specific layout at one specific window size. Offering it would mean shipping a number that is right once and wrong afterwards, which the page says rather than pretending otherwise.
Because 16px is only the default root size. A stylesheet that sets html { font-size: 62.5% } makes 1rem equal 10px, and a visitor who has raised their browser's default text size changes it too. That is why the root size is an input here rather than a constant.
A rem resolves against the document root and means the same thing anywhere in the page. An em resolves against the font size of the element it is used on, so it scales with that component — and compounds when em font sizes are nested inside each other.
rem, in nearly all cases. A rem font size respects a visitor's browser text-size setting and a px one overrides it, which is a real accessibility difference rather than a stylistic preference. Borders and hairlines are the usual exception.
No. A CSS inch is defined as exactly 96px, regardless of your display's actual pixel density. The absolute units are meaningful in print stylesheets, where that mapping is honoured, and misleading on screen.
Because neither has a single correct answer. A vw depends on the viewport size at the moment of rendering and a percentage depends on the parent element, so any px equivalent is true for one layout at one window size and wrong the rest of the time.