Unit Converter
CSS Unit Converter
Convert CSS lengths between six units with explicit font and viewport references, showing only the parameters needed by your selection.
CSS Unit Converter examples
These worked cases run absolute, font-relative and viewport units through the CSS Unit Converter.
| Input | Expected result |
|---|---|
| 96 px → pt | 72 pt |
| 24 px → rem, 16 px root | 1.5 rem |
| 10 vw → rem, 1440 px width, 16 px root | 9 rem |
| 10 vh → em, 800 px height, 20 px element font | 4 em |
Supported units & limits
Supports px, pt, rem, em, vw and vh for single element-style lengths. Values can be decimal or scientific notation, zero or signed lengths; font-size context disallows negatives. Required font sizes and viewport dimensions must be positive. Only relevant reference fields are used. Does not evaluate expressions, percentages, container units, media queries or dynamic viewport variants. Plain vw/vh use the large viewport basis in modern CSS. Unrepresentable results are rejected. Percentages need a containing block, which the CSS Unit Converter cannot know, so they are left out.
Common mistakes
Changing relative units matches one chosen font and viewport context, not every responsive state. Use CSS viewport dimensions rather than hardware screen resolution. em and rem can refer to different fonts. The tool accepts signed ordinary lengths, but the target CSS property may prohibit them. A point-to-pixel conversion does not measure glyph height or image PPI. The em reference differs for font-size and for other properties; choose the right context in the CSS Unit Converter.
Privacy
Conversions run in your browser. This site does not upload or store the values you enter. We use Google Analytics, loaded through Google Tag Manager, to count page visits and see which tools are used; Google may set cookies for this. The hosting server may keep standard access logs when you load a page.
Conversion guide
Compare two CSS units in the same layout context
Choose the source and destination units before supplying the references. Read computed font sizes and viewport dimensions from the target page. Copy the result, or swap to check the reverse conversion at that same context. Test relevant breakpoints separately because relative units can change independently.
CSS Unit Converter FAQ
Why do reference fields appear when I change units?
Relative units depend on fonts or viewport dimensions. The form shows only the references required by the source and destination units.
What does swapping units do?
It puts the unrounded converted result back into the length field, then exchanges source and destination units. The reference context stays the same.
Can this convert percentages or calc() expressions?
No. Percentage bases and expression evaluation depend on more CSS context. Enter one numeric length and choose one of the supported units.
Are equal numeric values always equal lengths?
No. One rem, em, vw and vh can all differ. They are equal only when their context produces the same CSS pixel length.