CSS Unit Converter
Convert between px, rem, em, pt, vw, vh, and % using your own base font size and viewport.
Base sizes (root, parent, viewport)
All units
- px16.000
- rem1
- em1
- pt12.000
- vw1.1111
- vh1.7778
- %100.00
How to use
- Type a value and pick a source unit (px, rem, em, pt, vw, vh, %).
- All other units update instantly.
- Expand the 'base sizes' panel to change root / parent font size or viewport.
- Copy the formatted value next to any unit.
About this tool
ShowHide
Type a value in any CSS unit and see it converted to all the others at once, with the root font size, the parent font size and the viewport dimensions all under your control so the numbers match the page you are actually building. The distinction worth internalising is between rem and em: rem always resolves against the root element, so it stays predictable however deeply an element is nested, while em resolves against the parent and therefore compounds — three levels of 0.9em leave you at about 0.73 of the original, which is where mysteriously shrinking text usually comes from. It is also why sizing in rem respects a reader who has raised their browser's default font size, and sizing in px quietly ignores them.
Frequently asked questions
Why are rem and em different?
rem is relative to the document root (html font-size, default 16 px). em is relative to the parent element. They're equal only when the parent itself uses the root size.
Why does pt = 1.333 px?
CSS defines 1 in = 96 px and 1 pt = 1/72 in, so 1 pt = 96/72 ≈ 1.333 px.
Are vw / vh accurate?
They use the viewport width and height you enter in the base-sizes panel. Default 1440 × 900 matches a common desktop; change them to match your design canvas.
What about %?
% is computed against the parent font size (treated the same as em for typography). For other CSS properties, % depends on the property's containing block.
Should I size text in rem or px?
rem, almost always. A reader who has raised their browser's default font size gets larger text with rem and is ignored entirely by px, which is a real accessibility failure rather than a style preference. Keep px for things that genuinely should not scale, like a hairline border.
Why did my nested text keep shrinking?
Because em compounds. Each level resolves against its parent, so three nested elements at 0.9em land at roughly 0.73 of the original — 0.9 × 0.9 × 0.9. rem cannot do this, since it always resolves against the root no matter how deep the element sits.
Related tools
CSS clamp() Calculator (Fluid Typography)
Build a fluid font-size: clamp(...) that scales smoothly between two viewport widths — copy a one-liner.
Color & CSS
Unit Converter
Convert length, weight, temperature, area, volume, speed, and time.
Convert
Radiation Dose Converter (Gy, Sv, rad, rem)
Convert absorbed dose between gray and rad and equivalent dose between sievert and rem, with the weighting factor needed to cross between them.
Convert
Density Converter
Convert density between kg/m³, g/cm³, g/mL, kg/L and lb/ft³, lb/in³, lb/gal, oz/in³, oz/gal and slug/ft³ — all at once.
Convert
Flow Rate Converter
Convert volumetric flow between m³/s, m³/h, L/s, L/min, L/h, mL/min, ft³/s, CFM, GPM, GPH, imperial gal/min and bbl/day — all at once.
Convert
Angle Unit Converter (Degrees · Radians · Gradians · DMS)
Convert any angle between degrees, radians, gradians, turns, milliradians, arcminutes, arcseconds and DMS, with a live SVG preview and π-fraction output.
Convert
Sleep Cycle Calculator (90-min cycles)
Find the best bedtime or wake time aligned to 90-minute sleep cycles so you wake up between cycles, not mid-deep-sleep.
Everyday