px

CSS Unit Converter

Convert between px, rem, em, pt, %, and vw instantly. Adjust base font size and viewport width for accurate results.

Reference values

Root font size, used for rem conversions

Used for em and % conversions

Used for vw conversions

Enter a value to convert

Conversions

UnitValueDescriptionCopy
px(input)16pxPixels — absolute screen unit
rem1remRoot em — relative to root font size
em1emEm — relative to the parent font size
pt12ptPoints — 1pt = 1.333px (print/CSS)
%100%Percent of parent font size (100% = 1em)
vw1.11111vwViewport width units (1vw = 1% of viewport)

Common values

About this tool

Convert px, rem, em, pt, vw and %

This CSS unit converter takes one value and shows it in six units at once: px, rem, em, pt, % and vw. You set the base font size and viewport width, so the results match your own project rather than fixed defaults.

How to use it

  1. Set the base font size in px (default 16). This is used for rem and em.
  2. Set the viewport width in px (default 1440). This is used for % and vw.
  3. Enter a value and pick its unit, or click one of the common px presets (4px to 64px).
  4. Read every unit in the table and click Copy to copy a value with its unit, such as 1.5rem.

Conversion formulas

Every value is first turned into pixels, then into each other unit:

  • rem / em = px ÷ base font size
  • pt = px × 0.75 (1pt = 1.333px)
  • vw / % = px ÷ viewport width × 100

Example with a 16px base and a 1440px viewport, starting from 24px:

UnitResult
rem24 ÷ 16 = 1.5rem
em1.5em
pt24 × 0.75 = 18pt
vw24 ÷ 1440 × 100 = 1.66667vw
%1.66667%

Results are rounded to six significant figures.

Limits to keep in mind

  • em is calculated from the same base as rem. In a real page, em depends on the parent element's font size, so the result is only correct when that equals your base.
  • % is treated as a percentage of the viewport width, the same as vw. In CSS, a percentage usually refers to the parent element, so check the context before using it.
  • Units such as mm, cm, vh, ch and ex are not included.

Frequently asked questions

How many px is 1rem?

With the browser default base of 16px, 1rem = 16px. If your root font size is different, change the base font size field.

How do I convert rem to px?

Choose rem as the input unit and enter the value. The px row shows the result, for example 2rem = 32px at a 16px base.

More to explore

Related Developer Tools

Browse all tools from the same category.

Showing 1-2 of 48