CSS Unit Converter
Convert between px, rem, em, pt, %, and vw instantly. Adjust base font size and viewport width for accurate results.
Reference values
Root font size, used for rem conversions
Used for em and % conversions
Used for vw conversions
Enter a value to convert
Conversions
| Unit | Value | Description | Copy |
|---|---|---|---|
| px(input) | 16px | Pixels — absolute screen unit | |
| rem | 1rem | Root em — relative to root font size | |
| em | 1em | Em — relative to the parent font size | |
| pt | 12pt | Points — 1pt = 1.333px (print/CSS) | |
| % | 100% | Percent of parent font size (100% = 1em) | |
| vw | 1.11111vw | Viewport width units (1vw = 1% of viewport) |
Common values
Convert px, rem, em, pt, vw and %
This CSS unit converter takes one value and shows it in six units at once: px, rem, em, pt, % and vw. You set the base font size and viewport width, so the results match your own project rather than fixed defaults.
How to use it
- Set the base font size in px (default 16). This is used for rem and em.
- Set the viewport width in px (default 1440). This is used for % and vw.
- Enter a value and pick its unit, or click one of the common px presets (4px to 64px).
- Read every unit in the table and click Copy to copy a value with its unit, such as
1.5rem.
Conversion formulas
Every value is first turned into pixels, then into each other unit:
- rem / em = px ÷ base font size
- pt = px × 0.75 (1pt = 1.333px)
- vw / % = px ÷ viewport width × 100
Example with a 16px base and a 1440px viewport, starting from 24px:
| Unit | Result |
|---|---|
| rem | 24 ÷ 16 = 1.5rem |
| em | 1.5em |
| pt | 24 × 0.75 = 18pt |
| vw | 24 ÷ 1440 × 100 = 1.66667vw |
| % | 1.66667% |
Results are rounded to six significant figures.
Limits to keep in mind
- em is calculated from the same base as rem. In a real page, em depends on the parent element's font size, so the result is only correct when that equals your base.
- % is treated as a percentage of the viewport width, the same as vw. In CSS, a percentage usually refers to the parent element, so check the context before using it.
- Units such as mm, cm, vh, ch and ex are not included.
Frequently asked questions
How many px is 1rem?
With the browser default base of 16px, 1rem = 16px. If your root font size is different, change the base font size field.
How do I convert rem to px?
Choose rem as the input unit and enter the value. The px row shows the result, for example 2rem = 32px at a 16px base.
Related Developer Tools
Browse all tools from the same category.
Domain Authority Checker
Check Moz authority, page authority, spam score, and backlink metrics
Open toolSEO Audit Tool
Audit a website URL for technical SEO, metadata, headings, broken internal links, hreflang, canonical and X-Robots-Tag checks, with report exports
Open toolShowing 1-2 of 48