CSS Unit Converter — px, rem, em, pt, cm, vw and More
Convert CSS pixels to rem/em and viewport percentages with custom root font size.
| Value | px | rem | em | pt | cm | mm | in | vw | vh | % |
|---|---|---|---|---|---|---|---|---|---|---|
| 16px | 16 | 1 | 1 | 12 | 0.4233 | 4.2333 | 0.1667 | 1.1111 | 1.7778 | 100 |
| 1.5rem | 24 | 1.5 | 1.5 | 18 | 0.635 | 6.35 | 0.25 | 1.6667 | 2.6667 | 150 |
| 12pt | 16 | 1 | 1 | 12 | 0.4233 | 4.2333 | 0.1667 | 1.1111 | 1.7778 | 100 |
| 2.54cm | 96 | 6 | 6 | 72 | 2.54 | 25.4 | 1 | 6.6667 | 10.6667 | 600 |
| 50vw | 720 | 45 | 45 | 540 | 19.05 | 190.5 | 7.5 | 50 | 80 | 4500 |
| 125% | 20 | 1.25 | 1.25 | 15 | 0.5292 | 5.2917 | 0.2083 | 1.3889 | 2.2222 | 125 |
When to use the CSS px, rem, em, vw, vh Unit Converter
Exact values per the CSS standard
Absolute units use the CSS Values ratios: 1 inch equals 96 px, 2.54 cm, 72 pt and 6 pc, so results match what browsers compute.
Relative units for your context
Set the root font size for rem, the parent font for em, the viewport size for vw and vh, and the 100% reference so conversions match your design.
Many values in one table
Paste a list of sizes from a design file and see them all in px, rem, em, pt, cm, mm, inches, vw, vh and percent at once.
Checked with the browser's CSS engine
Every formula is compared with the size Chrome actually computes for an element styled in the same unit, rem and vw included.
Frequently asked questions
Why use rem for font sizes?
rem follows the font size users choose in browser settings, so text grows for people with low vision, while px does not.
What is the difference between rem and em?
rem is based on the html element's font, the same across the page. em is based on the parent's font, so it compounds when nested.
When should I use vw and vh?
For sizes that follow the screen, such as a full-height hero. On phones consider dvh, because the browser's address bar changes the viewport height.
Which units suit print?
For print stylesheets, pt, cm and mm fit best because printers really use those physical sizes.
Similar tools
- DKIM Key Pair & _domainkey TXT Record GeneratorGenerate RSA/TXT selector._domainkey DNS record formatting cleanly.
- DMARC (_dmarc) Policy & Reporting TXT GeneratorConfigure v=DMARC1 p=none/quarantine/reject, pct & rua reporting records.
- SPF (v=spf1) Record & 10-Lookup Limit BuilderAssemble v=spf1 IPv4/IPv6/include mechanisms while checking RFC 10-lookup cap.
- RFC 8461 MTA-STS & TLS-RPT Record GeneratorGenerate /.well-known/mta-sts.txt and _mta-sts DNS TXT records together.