CSS Unit Converter
Convert px, rem, em, vw, vh and pt with explicit font and viewport dimensions. Export CSS or JSON.
css-unit-converterLOCAL WORKSPACE
Enabling local controls…
Settings
vw and vh use the supplied viewport. em uses the element font size. For a font-size declaration, enter the parent’s font size.
Results
| Unit | Equivalent | Action |
|---|---|---|
| px | 16px | |
| rem | 1rem | |
| em | 1em | |
| vw | 0.833333vw | |
| vh | 1.481481vh | |
| pt | 12pt |
CSS
:root {
--converted-px: 16px;
--converted-rem: 1rem;
--converted-em: 1em;
--converted-vw: 0.833333vw;
--converted-vh: 1.481481vh;
--converted-pt: 12pt;
}JSON
{
"px": "16px",
"rem": "1rem",
"em": "1em",
"vw": "0.833333vw",
"vh": "1.481481vh",
"pt": "12pt"
}How to use this tool
Choose a preset or edit the controls. Copy the result or download it when it is ready.
When not to use it
Use CSS pixels for viewport dimensions. Use the parent font size when em is part of font-size.