Web / CSS

CSS Unit Calculator

Convert CSS units such as px, rem, em, %, vw and vh. The tool helps with layouts, typography, responsive sizing and consistent CSS values.

Calculator

Convert a CSS value

All calculations run locally in your browser. No input is sent to the server.

Source value
Reference sizes

Some CSS units are relative. The calculator therefore uses concrete reference sizes for rem, em, %, vw and vh.

Options
Result 1rem

16px equal 16px as the shared calculation basis.

Unit Value Note

    Size preview

    The preview shows the calculated pixel value limited to a readable visual size.

    16px

    Output

    CSS code

    px

    px is useful for exact sizes, borders, icons and pixel-oriented layout details.

    rem and em

    rem is based on the root font size. em is based on the current context size.

    vw, vh and %

    vw and vh depend on the viewport. Percentage values also depend on the property and reference element.