By ToolzHive
About this tool
Convert CSS lengths using explicit font and viewport reference sizes.
How to use CSS Unit Converter
- Enter Value and choose its Unit.
- Set Root font size, Parent font or size, Viewport width and Viewport height to match your page.
- Click a converted value to copy it.
Worked example
With a 16px root font size, 32px corresponds to 2rem.
Are em and rem always the same?
No. rem refers to the root font size; em depends on the applicable font-size context. Enter the correct reference values.
Are percentage conversions universal?
No. CSS percentages depend on the property and containing block. This tool uses the supplied parent reference, so verify it matches your use case.
Put this guide into practice
- CSS Unit Converter — Convert between px, rem, em, pt, % and viewport units.