Converts between px, rem and em for a given root font size.
CSS Unit Converter turns a CSS length between px, rem and em based on a root font size you choose. Type a value like 24px, 1.5rem or 2em and it returns the equivalent in all three units. It is handy when translating fixed pixel designs into scalable rem/em values for responsive, accessible layouts.
No. The converter runs entirely in your browser, so nothing you type is uploaded or stored on any server.
A single number optionally followed by px, rem or em, such as 24px, 1.5rem or 2em. If you omit the unit, the value is treated as px.
The root font size (default 16px) is the px-per-unit factor used for rem and em. Changing it rescales the rem and em outputs, since px is multiplied by this base to and from rem/em.
This tool converts relative to the single root font size you set, so for a given base the rem and em results are identical. In real CSS, em is relative to the element's own font size, which can differ from the root.
Results are rounded to up to four decimal places, with trailing zeros removed, so 16px at a base of 16 returns a clean 1rem.