How to Convert CSS Units Online for Free
CSS has over a dozen unit types and choosing the right one — or converting a design spec from pixels into responsive rem values — takes mental arithmetic that slows you down. This guide explains the key units and shows you how to convert between them instantly using a free browser-based tool.
CSS Units Quick Reference
| Unit | Type | Relative to |
|---|---|---|
| px | Absolute | Device pixel (1/96 of an inch on screen) |
| rem | Relative | Root element font size (usually 16px) |
| em | Relative | Current element's font size |
| vw | Viewport | 1% of viewport width |
| vh | Viewport | 1% of viewport height |
| pt | 1/72 of an inch | |
| cm / mm / in | Physical dimensions |
Step-by-Step Instructions
Open the CSS Unit Converter
Navigate to the free CSS Unit Converter. It runs entirely in your browser — no account, no server, no tracking.
Enter the source value
Type a number into any unit field (e.g. 24 in the px field). All other fields update immediately.
Set the root font size (if needed)
The default base font size is 16px, matching most browser defaults. If your project uses html { font-size: 62.5% } (which gives 10px), set the base to 10. This affects rem and em results.
Set the viewport dimensions (if needed)
vw and vh conversions require knowing the viewport size. The defaults (1440×900) cover most desktop screens. Update them for your target device.
Copy the value you need
Click any output field to select it, then press Ctrl+C (Cmd+C on Mac) to copy. Paste directly into your stylesheet.
When to Use Each Unit
- rem — preferred for font sizes, spacing, and layout that should scale with the user's browser font-size setting
- px — borders, box shadows, and precise dimensions that should not scale
- em — spacing relative to the component's own font size (e.g. line-height: 1.5em)
- vw / vh — full-screen sections, fluid typography with clamp(), hero heights
- pt / cm — print stylesheets only
Convert CSS units now
px → rem, em, vw, vh, pt, cm and more — 100% browser-based, no uploads, no account.
Open CSS Unit Converter