How to Convert CSS Units

Convert between CSS units instantly: px, rem, em, vh, vw, %, pt, and more. Free online converter with responsive design context and base font size configuration.

Open CSS Units Converter →

Step-by-Step Guide

1

Enter your value

Type the numeric value you want to convert into the input field. You can enter whole numbers or decimals — the tool handles precise conversions for values like 1.5rem, 16px, or 2.25em with full floating-point accuracy.

2

Select the source unit

Choose the CSS unit you are converting from — pixels (px), root em (rem), em, viewport height (vh), viewport width (vw), percentage (%), points (pt), or other supported units. The tool covers all CSS length units defined in the specification.

3

Select the target unit

Pick the unit you want to convert to. The converter instantly calculates the equivalent value based on the configured base font size (default 16px for rem/em) and viewport dimensions. You can adjust these base values to match your project settings.

4

View conversion with context

See the converted value along with practical context — how it renders at different screen sizes, the mathematical formula used, and common use cases. Copy the result with the unit suffix ready to paste into your CSS stylesheet or design system tokens.

Try It Now — Free

No signup, no download. Runs entirely in your browser.

Open CSS Units Converter

Frequently Asked Questions

When should I use rem instead of px?
Use rem for typography, spacing, and layout dimensions that should scale with user preferences. Rem units are relative to the root font size, so they respect browser accessibility settings. Use px only for borders, shadows, and elements that should stay pixel-perfect regardless of user settings.
What base font size does the converter use?
The default base font size is 16px, which is the browser default for the root element. This means 1rem = 16px. You can change the base font size in the converter settings to match your project — if your CSS sets html { font-size: 62.5% }, then 1rem = 10px.
What are viewport units (vh and vw)?
Viewport height (vh) and viewport width (vw) are relative to the browser window size. 1vh equals 1% of the viewport height, and 1vw equals 1% of the viewport width. They are ideal for full-screen layouts, hero sections, and responsive sizing that adapts to the user screen dimensions.
Related Reference

CSS Grid Cheat Sheet

View Cheat Sheet →

More Guides