CSS Units Converter
Convert between any CSS units with accurate, context-aware calculations. Enter a value, pick a source unit, and see the equivalent in all 14 CSS unit types instantly.
Supported Units
| Unit | Type | Description |
|---|---|---|
px | Absolute | Pixel, the base unit for screen display |
pt | Absolute | Point (1pt = 1/72 inch, 1pt ≈ 1.333px) |
pc | Absolute | Pica (1pc = 12pt) |
cm | Absolute | Centimeter |
mm | Absolute | Millimeter |
in | Absolute | Inch (1in = 96px) |
rem | Relative | Root em, relative to root font size |
em | Relative | Em, relative to parent font size |
vw | Viewport | 1% of viewport width |
vh | Viewport | 1% of viewport height |
vmin | Viewport | 1% of smaller viewport dimension |
vmax | Viewport | 1% of larger viewport dimension |
ex | Font | Approximate x-height (≈ 0.5em) |
ch | Font | Approximate character width (≈ 0.6em) |
How to Use
- Enter a numeric value in the input field
- Select the source unit from the dropdown
- See the converted value in every other unit
- Adjust base font size or viewport dimensions in Context Settings for accurate relative conversions
- Click the copy icon next to any result to copy it
Common Use Cases
Responsive Design with rem
When building responsive layouts, converting between px and rem ensures your spacing scales correctly with user preferences. The default base font size is 16px, matching most browsers.
Media Query Viewport Units
Convert pixel breakpoints to viewport units for fluid responsive designs. A 1440px container equals 100vw at that viewport width.
Cross-Browser Font Sizing
Different browsers have different default font sizes. Using rem instead of px ensures consistent rendering even when users adjust their browser settings.
Print Stylesheets
Converting screen units (px) to print units (pt, cm, in) helps create accurate print stylesheets.