freetoolsY

CSS Units Converter

NewDeveloper

Convert CSS values between px, rem, em, %, vw and vh using a configurable base font size and viewport. See every unit at once. Free for developers.

UnitValue
Pixels (px)source16 px
Rem1 rem
Em1 em
Percent (%)100 %
Viewport width (vw)0.83 vw
Viewport height (vh)1.48 vh

rem and em use the base font size; vw and vh use the viewport. Adjust them to match your design system.

Which units does it convert?

It converts between px, rem, em, %, vw and vh. The base units depend on the base font size (for rem and em), the viewport width (for vw) and the viewport height (for vh).

What is the difference between rem and em?

Both are relative to font size: rem uses the root font size, and em uses the font size of the current element. This tool assumes both follow the base font size you configure.

Why do I need the viewport size?

vw and vh are percentages of the viewport. Without knowing a concrete viewport, like 1920×1080, those units cannot be converted to a pixel value.

How do I set custom base values?

The default base font size is 16px and the default viewport is 1920×1080 — the most common desktop values. Change them to match your design system or target device.

Is the percent unit interpreted correctly?

Percentages are interpreted relative to the base font size, matching the common pattern for font sizes in CSS. The tool shows every unit side by side so results are easy to compare.

Frequently Asked Questions

Similar tools

View all tools

Popular tools

View all tools

Want to share what you created? Try linklyhub.com for a short, clean link.