CSS Units Converter
Convert between px, rem, em, %, vw, vh, pt, cm and more using your root font size and viewport, with a px-to-rem table and vw values on common screens.
Free, no sign-up
Your data stays on your device
Works offline after first open
The tool
Loading the tool…
How to use
- Enter the value and choose its unit.
- Set the root font size (usually 16px), the parent font size for em or %, and the viewport for vw and vh.
- Copy the value in any unit from the table.
- Use the quick px ↔ rem table and the common-screens table for viewport units.
Privacy & how it works
Processes your data in the browser and stores nothing.
- Engine: lightweight in-page code, no external libraries.
- Works offline after you open it once.
Frequently asked questions
What is the difference between rem and em?
rem is relative to the font size of the html (root) element, so it is the same across the page. em is relative to the parent’s font size, so it compounds when elements are nested.
Why is 1pt = 1.333px?
In CSS an inch is defined as 96px and an inch is 72pt, so 1pt = 96 ÷ 72 = 1.333px. These are CSS reference units, not necessarily physical sizes on your screen.
What is % relative to here?
Here % is relative to the parent font size (as in font-size: 150%). For properties like width it is relative to the container width, so enter the container width as the “parent size” if you need that.
Formulas & sources
Related tools
CSS clamp() GeneratorEnter the smallest and largest size and the two screen widths to get a ready CSS clamp() for fluid type or spacing, with a value table and a full fluid type scale.Type & Spacing ScalePick a base font size and ratio to get a harmonious size scale for headings and text with an Arabic and English preview, plus a spacing scale, exported as CSS, Tailwind or JSON.Unit ConverterConvert length, mass, area, volume, speed, time, temperature, pressure, energy and digital storage (GB vs GiB) using exact conversion factors, with a table of every unit in the category.DPI & PPI CalculatorWork out screen PPI from resolution and diagonal, the print size of an image at any DPI, the pixels needed to print A4 or any size, and whether your image is sharp enough to print.