Text-Converters

CSS Unit Converter

Convert between all CSS units — px, rem, em, pt, cm, mm, in, vw, vh, and % — instantly. Set a custom root font size and viewport to get accurate results for your project.

Convert From
Context Settings

Used for rem, em, and % calculations. Default is 16px.

Used for vw calculations. Default is 1440px.

Used for vh calculations. Default is 900px.

Results
Pixels (px)
16 px
Root em (rem)
1 rem
Em (em)
1 em
Points (pt)
12 pt
Centimetres (cm)
0.423333 cm
Millimetres (mm)
4.23333 mm
Inches (in)
0.166667 in
Viewport Width (vw)
1.11111 vw
Viewport Height (vh)
1.77778 vh
Percent (%)
100 %
About the CSS Unit Converter

CSS offers a wide range of units for expressing lengths, sizes, and positions, and choosing the right one matters for responsive, accessible design. Pixel values are concrete and predictable, but relative units like rem and em scale with the user's browser font preferences — making your design more accessible. Viewport units like vw and vh tie measurements to the screen size, which is useful for full-page sections, hero blocks, and fluid typography. This converter handles all ten common CSS length units and lets you set your own root font size and viewport dimensions to match your actual project context.

How to Use This Tool

  1. Enter a value in the "Value" field — for example, 16.
  2. Select the source unit from the dropdown — for example, px.
  3. Adjust the context settings if needed: change the root font size (default 16px) or viewport dimensions to match your project.
  4. Read the results — all ten units are shown simultaneously. The source unit is highlighted.
  5. Copy any value using the copy icon next to each result row.

Common Use Cases

  • Responsive design: Convert a pixel value from a design mockup into rem units so the layout scales correctly when users change their browser font size.
  • Accessible typography: Set body text sizes in rem instead of px so that users who have set a larger default font size in their browser see the text scale accordingly.
  • Fluid layouts: Convert a fixed pixel width into a vw percentage to make a container responsive to the viewport rather than a fixed size.
  • Print stylesheets: Convert pixel or rem values into pt or cm units when writing CSS for printed documents, which use physical units rather than screen pixels.
  • Cross-checking designs: Quickly verify that a spacing value expressed in one unit matches the intended value in another unit when reviewing a design system.