CSS Unit Converter

Convert CSS units — px to rem, em, pt, % and more — with a custom base font size — free online.

em and % are relative to a parent element's font size in real CSS — this treats the base font size you enter as that parent value.

About

About the CSS Unit Converter

Converts a CSS length value between px, rem, em, pt, pc, in, cm, mm and percent, using a base font size you set, and shows the equivalent value in every one of those units at once.

Front-end developers use it to convert a design's pixel measurements into rem values for a stylesheet, while designers use it to check what a font size in points or picas translates to on screen. It's part of Toolapt's broader lineup of free converters, open to everyone with no account and no limit on repeat runs.

Choose what to view about this tool

Guide

Using the CSS Unit Converter

  1. 1

    Step 1

    Enter the value you want to convert.

  2. 2

    Step 2

    Choose the unit it's currently in — px, rem, em, pt, pc, in, cm, mm or %.

  3. 3

    Step 3

    Set the base font size in pixels (16 is the common browser default).

  4. 4

    Step 4

    Read the converted value in every other unit in the results below.

  • Converts between nine CSS length units at once — px, rem, em, pt, pc, in, cm, mm and %
  • Uses a base font size you control, instead of assuming a fixed 16px default for every calculation
  • Shows every unit's equivalent value side by side, not just the one conversion you asked for
  • Updates instantly as you change the value, unit or base font size
  • Works entirely in your browser — no installs and no sign-up
  • Free to use, with no limit on how many times you run it
  • Fully responsive, so it works just as well on a phone as on a desktop

Front-end developers

Front-end developers use the CSS Unit Converter for converting a design's pixel measurements into rem values for a stylesheet that respects user font-size preferences.

Designers

Designers use the CSS Unit Converter for checking what a font size specified in points or picas translates to in pixels on screen.

Students learning CSS

Students learning CSS use the CSS Unit Converter for seeing how relative units like rem and em relate to a fixed pixel value.

Anyone converting a design spec

Anyone converting a design spec uses the CSS Unit Converter for translating a measurement from a design tool's units into the CSS unit their code needs.

Examples

CSS Unit Converter examples

2 worked examples

01

px to rem

16px at a 16px base font size equals 1rem — the most common everyday conversion.

02

A larger heading

32px at a 16px base equals 2rem, or 24pt.

FAQ

Frequently asked questions

Quick answers to common questions about the CSS Unit Converter.

What does the CSS Unit Converter do?

It converts a value between px, rem, em, pt, pc, in, cm, mm and percent, using a base font size you set, and shows the equivalent value in every one of those units.

Is the CSS Unit Converter free to use?

Yes. It's free, with no sign-up, no watermark and no limit on how many times you use it.

Is my input safe when I use this tool?

Yes. The value and base font size you enter are processed entirely on your own device — nothing is sent to a server.

What is the base font size for?

rem, em and percent are all relative units — they only have a concrete pixel size once you know the font size they're relative to. The base font size field lets you set that reference value instead of assuming a fixed default.

What's the difference between rem and em here?

In real CSS, em is relative to its own element's font size while rem is always relative to the root element's font size; since this tool works with a single base value, it treats both as relative to the base font size you enter.

Why would I convert to physical units like in, cm or mm?

Those come in handy for print stylesheets or any design work where a length needs to correspond to an actual physical measurement rather than a screen-relative one.

Can I use the CSS Unit Converter on my phone?

Yes. The page is fully responsive and works on mobile, tablet and desktop browsers alike.

Does the CSS Unit Converter have any limitations?

It covers the standard CSS length units; it doesn't include viewport-relative units like vw or vh, since those depend on the browser window size rather than a font size.

Still have a question? Contact us

Report a problem

CSS Unit Converter

What went wrong?
    or paste a screenshot