What the CSS Unit Converter does
The CSS Unit Converter turns a size in any CSS unit into all the others at once: px, rem, em, %, vw, vh, vmin, vmax, pt, pc, in, cm, mm and Q. Set the root font size for rem, the parent font size for em and %, and the viewport size for vw and vh, so the results match your design. A table converts common pixel sizes to rem, pt and vw.
How to use it
- Enter a value and choose its unit.
- Set the root and parent font sizes and the viewport width and height.
- Copy the result in the unit you need.
- Use the table for quick px to rem look-ups.
Example
1.5rem with the usual 16 px root is 24px, 18pt, 1.5pc, 0.25in, 0.635cm, 6.35mm and 25.4Q. On a 1440 × 900 screen it is 1.6667vw and 2.6667vh. In the table, 14px is 0.875rem and 10.5pt.
Which unit to use
Use rem for font sizes and spacing, so everything grows when visitors set a larger text size in their browser. em is relative to the element’s own font size, useful for padding inside buttons that should scale with their text. vw and vh follow the screen, good for full-screen sections but risky for text, which can become tiny on phones; combine them with clamp().
The physical units in, cm, mm and pt are fixed by CSS at 96 px to the inch. They are meant for print style sheets; on screens the real size depends on the display.
Questions people ask
Is anything uploaded?
No. Everything is worked out in your browser, so your colours, designs and images stay on your device.
What does % mean here?
A font size as a share of the parent’s font size. Widths in % depend on the parent’s width instead.
Why is 1in exactly 96px?
CSS defines it that way, so designs look the same everywhere; it is not the real physical inch on every screen.
What is the Q unit?
A quarter of a millimetre, used in Japanese typography.