CSS Unit Converter
Enter a value like 24px, 1.5rem or 12pt and get the equivalent in px, rem, em, pt and % — using configurable root font size, parent font size and percent base. Follows the CSS absolute-length definitions (96 px per inch).
🔒 100% Client-Side & Private — processed locally in your browser. Files never leave your device.
Options
Your result will appear here
Type or paste your input above, adjust the options, then press Run. Tip: press Ctrl+Enter to run, and ? for every shortcut.
How it works
What the CSS unit converter returns
Enter a single length such as 24px, 1.5rem or 12pt and the tool returns a table with the equivalent in px, rem, em, pt and percent, using the CSS absolute-length definition of 96 pixels per inch. A summary line highlights whichever target unit you selected.
Translating a design into rem
Use it when a design handoff arrives in points or pixels and your codebase works in rem: typing the value shows the rem equivalent at your root size at once, and switching the root font size option lets you see what happens at a different base without editing any CSS.
The settings that change the answer
Root font size drives rem, parent font size drives em and the percent base drives %. The target unit choice only decides which row is echoed in the summary. Set the three sizes to your real page values, and the conversions match what the browser would compute for that context.
Limits to keep in mind
Input is one number with an optional unit, so compound expressions like calc() are not evaluated. Viewport units such as vw and vh are not supported, since they depend on a live viewport rather than a font size. Results are rounded to four decimal places, which is plenty for layout values.
Conversion without a round trip
The arithmetic runs in the page and no network request is made, so the tool works offline. Nothing you type is transmitted, and repeated conversions of a whole spacing scale stay on your device.
Questions
Why is em and % the same value here?
Both resolve against a font size — em against the parent font size and % against the percent base. With both left at 16 px they match; change either option to model a different context.
What does the highlighted target unit do?
It only decides which conversion is surfaced in the summary line, so the value you care about is easy to spot. The table always lists px, rem, em, pt and % together, so you never need to re-run the conversion to read a different unit.
Which units can I type?
Any of px, rem, em, pt, pc, in, cm, mm and %. If the number has no unit the Unit when input has none choice fills it in. Conversions use the CSS absolute-length definition of 96 pixels per inch, and em, rem and % follow the font sizes you set.
Related tools
See categoryAspect Ratio Calculator
Solve, simplify or look up common aspect ratios and resolutions.
CSS Gradient Generator
Build linear, radial and conic CSS gradients with custom colour stops.
:nth-child An+B Evaluator
Parse CSS An+B (:nth-child, :nth-of-type) microsyntax, validate it, and list which child indices it matches.
.editorconfig Generator
Generate an .editorconfig with your indentation, line-ending and charset settings.