Free CSS Unit Converter - px, rem, em, %, vw, vh

Convert CSS length units with live previews, viewport presets, and all-unit output

CSS Unit Converter

Convert between px, rem, em, %, vw, and vh with live results. Adjust root font size, relative base, and viewport to match your real layout context.

Input

Conversion updates instantly as you type.

Negative values are supported for spacing and transforms.


Context

Set the environment used for relative units.

Viewport presets

Result

Primary conversion plus all unit equivalents.

Primary Conversion

16px = 1rem

1rem = 16px | 1vw = 14.4px | 1vh = 9px

Reference Values

Common CSS units at a 16px root font size and 1440px viewport width.

Expression Equivalent
1rem16px
0.875rem14px
1.5rem24px
10vw at 1440px width144px
50% of 960px container480px
100vh at 900px height900px

About This CSS Unit Converter

All conversions go through pixels as the internal base. Relative units depend on your context inputs:

  • rem uses Root Font Size.
  • em uses the same base value as rem in this tool, useful when component font size equals root size.
  • % uses the editable Relative Base field.
  • vw and vh use the viewport width and height fields.

Use this for responsive typography, spacing scales, and quick checks before writing production CSS.

Privacy & Limitations

  • All calculations run entirely in your browser -- nothing is sent to any server.
  • Results are estimates and may vary based on actual conditions.

Related Tools

Related Tools

View all tools

CSS Unit Converter FAQ

How do I convert px to rem?

Divide pixels by the root font size. Example: 24px with a 16px root size equals 1.5rem.

What is the difference between rem and em?

rem is relative to the root html font size. em is relative to the current element's font size. In this tool, em uses the same editable base value so you can model your component context.

How is percent converted in CSS?

Percent values are relative to another value, such as parent width, parent height, or parent font size depending on property context. This converter lets you set that relative base directly.

How do vw and vh work?

1vw is 1% of viewport width and 1vh is 1% of viewport height. If viewport width is 1200px, then 10vw equals 120px.

Does this tool store my values?

No. All calculations run in your browser. No values are sent to a server.

Request a New Tool
Improve This Tool