Convert CSS Units

Convert between CSS units instantly. Supports px, rem, em, %, vw, vh, pt, cm, mm, and in with configurable context values.

The CSS Unit Converter translates any CSS length value into all other common units simultaneously. Enter a value in px, rem, em, %, vw, vh, pt, cm, mm, or in, and see every equivalent displayed at once. Customize the base font size, parent font size, viewport dimensions, and container width so that relative units convert accurately for your specific project. Copy any result with one click. Everything runs in your browser; no data leaves your device.

Your data stays in your browser
Was this tool useful?
Tutorial

How to use

1
1

Enter a value and select the source unit

Type the numeric value you want to convert and choose its current unit from the dropdown (px, rem, em, etc.).

2
2

Adjust context settings if needed

Set the base font size, parent font size, viewport dimensions, and container width to match your project for accurate relative unit conversions.

3
3

Read the results and copy

All equivalent values appear instantly. Click the Copy button next to any unit to copy that value to your clipboard.

Guide

Complete Guide to CSS Units

Absolute vs. Relative Units

CSS units fall into two categories. Absolute units (px, pt, cm, mm, in) have fixed physical sizes. Relative units (rem, em, %, vw, vh) scale based on context such as font size or viewport dimensions. Relative units are essential for responsive web design because they adapt to different screens and user settings.

Understanding rem and em

rem references the root element's font size; if html has font-size: 16px, then 1rem equals 16px everywhere. em references the current element's parent font size, which means nested em values compound. Most modern frameworks prefer rem for consistency and predictability across deeply nested components.

Viewport Units: vw and vh

1vw equals 1% of the viewport width; 1vh equals 1% of the viewport height. These units are powerful for full-screen layouts, responsive typography, and spacing that scales with the browser window. Be cautious on mobile where the address bar can affect the viewport height.

When to Use Physical Units

Physical units like pt, cm, mm, and in are intended for print media. Points (pt) are standard in print typography where 72pt equals one inch. Use physical units in @media print stylesheets; avoid them for screen layouts because screen DPI varies across devices.

Examples

Worked Examples

Example: Convert 24px to rem

Goal: Find the rem equivalent of 24px with a 16px base font size.

1

Step 1: Enter 24 as the value and select px as the source unit.

2

Step 2: Confirm the base font size is set to 16px.

3

Step 3: Read the rem result: 1.5rem.

Result: 24px equals 1.5rem with a 16px root font size.

Example: Convert 50vw to px for a 1440px viewport

Goal: Find the pixel width of an element that spans 50% of a 1440px-wide viewport.

1

Step 1: Enter 50 as the value and select vw as the source unit.

2

Step 2: Set viewport width to 1440 in the context settings.

3

Step 3: Read the px result: 720px.

Result: 50vw equals 720px on a 1440px-wide viewport.

Use Cases

Use cases

Converting a Design Mockup to rem Units

Designers often deliver pixel-based specifications. Use this converter to translate every px value into rem so your stylesheet scales correctly with the user's browser font size preferences.

Calculating Viewport-Relative Sizes

When building full-screen hero sections, you need values in vw and vh. Enter the desired pixel size, set your target viewport dimensions, and read the exact vw or vh value to use.

Print Stylesheet Conversion

Print stylesheets require physical units like pt, cm, or in. Convert your screen-based px values into print-friendly units for accurate paper output.

Frequently Asked Questions

?What is the difference between rem and em?

rem is relative to the root element's font size (usually the html element). em is relative to the parent element's font size. rem provides more predictable sizing because it does not compound with nesting.

?Why do I need to set a base font size?

rem and certain relative calculations depend on the root font size. Browsers default to 16px, but your project may override this. Setting the correct base ensures accurate conversions.

?How does viewport width affect vw conversions?

1vw equals 1% of the viewport width. If your viewport is 1920px wide, 1vw equals 19.2px. Setting the correct viewport width ensures the conversion matches your target screen.

?What is the relationship between px and pt?

On screens at 96 DPI, 1pt equals approximately 1.333px. Points are a physical unit traditionally used in print typography; 72pt equals 1 inch.

?Can I convert percentage values accurately?

Yes, but percentage values are relative to the parent container's width. Set the container width in the context settings so the converter can calculate the correct pixel equivalent.

?Is this CSS unit converter free?

Yes, this tool is completely free with no registration required. There are no usage limits, no premium tiers, and no ads.

?Is my data private and secure?

Absolutely. All conversions happen entirely in your browser. No values are sent to any server. Your data stays completely private on your device.

?Which CSS units work best for responsive design?

rem is preferred for typography and spacing because it respects user font preferences. vw and vh work well for viewport-relative sizing. Percentages are ideal for fluid container widths. Combining these units creates robust responsive layouts.

Help us improve

How do you like this tool?

Every tool on Kitmul is built from real user requests. Your rating and suggestions help us fix bugs, add missing features and build the tools you actually need.

Rate this tool

Tap a star to tell us how useful this tool was for you.

Suggest an improvement or report a bug

Missing a feature? Found a bug? Have an idea? Tell us and we'll look into it.

Related Tools

Recommended Reading

Recommended Books on CSS Units & Responsive Design

As an Amazon Associate we earn from qualifying purchases.

Boost Your Capabilities

Recommended Products for Web Developers

As an Amazon Associate we earn from qualifying purchases.

Newsletter

Get Free Productivity Tips & New Tools First

Join makers and developers who care about privacy. Every issue: new tool drops, productivity hacks, and insider updates — no spam, ever.

Priority access to new tools
Unsubscribe anytime, no questions asked