Search and jump to any tool. Type to filter; use arrow keys to move and Enter to select.
Converts a CSS length between px, rem, em, pt, pc, in, cm, mm, percent, vw and vh and shows all eleven results in one table.
Converts a CSS length between px, rem, em, pt, pc, in, cm, mm, percent, vw and vh and shows all eleven results in one table. Relative units depend on context, so you can set the root font size, parent font size and viewport size the conversion should assume. It is handy for turning a design spec in pixels into rem values for a stylesheet.
Value: 1.5rem Context: root 16px, parent 16px, viewport 1440 by 900
24px | 1.5rem | 1.5em | 18pt | 1.5pc | 0.25in | 0.635cm | 6.35mm | 150% | 1.6667vw | 2.6667vh
Good to know. All four context values must be positive numbers or an error appears. Only these eleven units are supported, so ch, ex, vmin, vmax and container-query units are not converted.
1.5rem to set the unit too.0-10, defaults to 4.
The html element's font-size — the basis for rem.
The containing element's font-size — the basis for em and %.
1vw is 1% of this value.
1vh is 1% of this value.
| Unit | Value | Basis | Copy |
|---|---|---|---|
| px | 16px | Absolute device-independent pixels. | |
| rem | 1rem | Relative to the root font size. | |
| em | 1em | Relative to the parent font size. | |
| pt | 12pt | Points — 1pt = 1/72in = 1.333px. | |
| pc | 1pc | Picas — 1pc = 12pt = 16px. | |
| in | 0.1667in | Inches — 1in = 96px by CSS definition. | |
| cm | 0.4233cm | Centimetres — 1cm ≈ 37.795px. | |
| mm | 4.2333mm | Millimetres — 1mm ≈ 3.7795px. | |
| % | 100% | Percentage of the parent font size. | |
| vw | 1.1111vw | 1% of the viewport width. | |
| vh | 1.7778vh | 1% of the viewport height. |