Skip to content

PX to REM Converter

Convert px to rem and rem to px at any root font size, plus em, %, pt, pc, inches, cm, mm, Q, vw and vh, with a table of common sizes and line-height help.

Calculator Details

24px =1.5remSee results ↓

The size to convert

The unit of the value

The unit you want

html { font-size }: 16px in every browser unless changed; sets 1rem

Sets 1em and 100% for font sizes

Your Results

24px = 1.5rem

24px =

1.5rem

Root font size 16px, 96 pixels per inch

Pixels (px)

24px

Em (em)

1.5em

Percent of parent font (%)

150%

Points (pt)

18pt

Picas (pc)

1.5pc

Inches (in)

0.25in

Centimetres (cm)

0.635cm

Millimetres (mm)

6.35mm

Quarter-millimetres (Q)

25.4Q

Viewport width (vw)

1.6667vw

Viewport height (vh)

2.6667vh

As a font size: line-height 36px; letter spacing 0em = 0px.

24px = 1.5rem with a 16px root font size (24px, 18pt at 96 pixels per inch).

Detailed Breakdown

Common sizes at a 16px root
pxremem (16px parent)pt
10px0.625rem0.625em7.5pt
12px0.75rem0.75em9pt
14px0.875rem0.875em10.5pt
16px1rem1em12pt
18px1.125rem1.125em13.5pt
20px1.25rem1.25em15pt
24px1.5rem1.5em18pt
28px1.75rem1.75em21pt
32px2rem2em24pt
40px2.5rem2.5em30pt
48px3rem3em36pt
64px4rem4em48pt

How This Calculator Works

How it is calculated

rem = px ÷ root font size · em = px ÷ parent font size · % = em × 100

1in = 96px = 72pt = 6pc = 2.54cm = 25.4mm = 101.6Q (CSS) · 1vw = viewport width ÷ 100

Your numbers: 24px = 24px. 24 ÷ 16 = 1.5rem; 24 × 72 ÷ 96 = 18pt.

Frequently Asked Questions

How do I convert px to rem?

Divide the pixel value by the root font size. With the browser default of 16px, 24px ÷ 16 = 1.5rem and 14px ÷ 16 = 0.875rem. To go from rem to px, multiply: 2rem × 16 = 32px.

What is the difference between rem and em?

rem is relative to the root (html) element’s font size, so 1rem is the same everywhere on the page. em is relative to the current element’s font size (for font-size, the parent’s), so nested em sizes compound: 1.2em inside 1.2em is 1.44 times the outer size.

Why use rem instead of px?

Sizes in rem scale when a reader changes the browser’s default font size, which helps people with low vision; px font sizes ignore that setting. The Web Content Accessibility Guidelines ask that text can be resized to 200% without loss of content.

What is the 62.5% trick?

Setting html { font-size: 62.5% } makes the root 10px (62.5% of 16px), so 1.6rem = 16px and conversions are easy. It still respects the user’s setting, but third-party components that assume a 16px root will come out smaller. Set the root font size to 10 to convert for it.

How many pixels is 12pt?

16px in CSS, because CSS fixes 1in at 96px and a point is 1/72 inch: 12 × 96 ÷ 72 = 16. In a design file at 72 dpi, 12pt is 12px; at 300 dpi for print it is 50px. Pick “device pixels” to convert at a DPI.

Is a CSS inch a real inch?

Only on print and on screens whose pixel density happens to match. CSS defines 1in as 96 reference pixels, and browsers scale reference pixels to the device, so a CSS inch on a phone or laptop is usually not exactly an inch. For physical sizes on paper, CSS units are accurate.

How do I convert vw to px?

1vw is 1% of the viewport width. At a 1,440px wide window, 50vw = 720px; on a 375px phone, 50vw = 187.5px. Set the viewport size in the advanced options.

How do I convert letter spacing from Figma or Adobe?

Adobe tracking is in thousandths of an em, so tracking 50 is letter-spacing: 0.05em. Figma shows letter spacing as a percentage of the font size, so 5% is also 0.05em. On 24px text, 0.05em is 1.2px.

Unit definitions from the W3C CSS Values and Units Module Level 4 (§6.1 font-relative and §6.2 absolute lengths): 1in = 96px = 72pt = 6pc = 2.54cm. CSS pixels are reference pixels, not screen pixels: a phone with a device pixel ratio of 3 draws each CSS pixel with 3 × 3 physical pixels. The device-pixel option uses your DPI for print and design files instead. em and % here are relative to the parent font size, as for the font-size property; for other properties % refers to the containing block. Not included: ch, ex, cap, lh and rlh units, container query units (cqw), small/large/dynamic viewport units (svh, lvh, dvh), and fluid clamp() type scales.

PX to REM Converter: rem, em, pt and Every CSS Length Unit

By FindMySum · Last reviewed

This px to rem converter turns pixel sizes into rem units at whatever root font size your site uses, and converts between every common CSS length: em, percent, points, picas, inches, centimetres, millimetres, Q, vw and vh. It also lists a table of common sizes, works out line height in pixels and turns design-tool letter spacing into CSS. An advanced option switches from CSS reference pixels to device pixels at a DPI, for print and design files.

Worked example: 24px

The converter opens with 24px and the browser default root font size of 16px.

  1. rem. 24 ÷ 16 = 1.5rem.
  2. Points. CSS fixes one inch at 96px and one point at 1/72 inch, so 24px × 72 ÷ 96 = 18pt.
  3. Physical size. 24 ÷ 96 = 0.25 inch, which is 0.635 cm or 6.35 mm.
  4. Line height. With line-height: 1.5, a 24px heading's lines are 36px apart.

If the site sets html { font-size: 62.5% }, the root is 10px and the same 24px is 2.4rem.

rem, em and percent

Font-relative units make text and spacing scale together.

  • rem (root em) is the font size of the html element. Browsers default it to 16px, and readers can change that in their settings. Because every rem refers to the same root, rem values don't compound, which makes them the usual choice for a design system's type scale and spacing.
  • em is the font size of the element itself; for the font-size property it is the parent's font size. A 1.25em heading inside a 20px container is 25px. Nesting em sizes multiplies them, which is useful for components that should scale with their surroundings and surprising when it is accidental.
  • % for font-size works like em times 100: 150% is 1.5em.

Absolute units: the CSS inch

CSS defines its absolute units from a fixed ratio: 1in = 2.54cm = 96px = 72pt = 6pc. The px in this list is the reference pixel, an angle of view chosen so that text is readable at arm's length, not a physical dot on the screen. A phone with a device pixel ratio of 3 paints every CSS pixel with nine hardware pixels. So on screens a CSS inch is rarely an exact physical inch, but in print, where browsers lay out at the real size of the paper, it is.

Points and picas come from printing: a point is 1/72 inch (the PostScript point adopted by desktop publishing) and a pica is 12 points. Q, a quarter-millimetre, is the Japanese typesetting unit.

Device pixels for print and design files

Image editors and print workflows count real pixels at a resolution in dots or pixels per inch. At 72 pixels per inch, the old Mac screen resolution that desktop publishing grew up with, one point is one pixel. At 300 pixels per inch, the common target for print, one inch is 300 pixels and 12pt type is 50 pixels tall. Choose "device pixels" and enter the resolution to convert at that density instead of the CSS 96.

Viewport units

1vw is 1% of the viewport width and 1vh 1% of its height. They are handy for full-screen sections and fluid type, but text sized only in vw doesn't respond to the reader's zoom or font settings, so fluid type is usually written with clamp() combining rem and vw. Enter your viewport size in the advanced options to see the pixel value.

Accessibility and the root font size

The Web Content Accessibility Guidelines require that text can be resized up to 200% without losing content or function. Font sizes in rem or em honour a reader's default font size; font sizes in px don't respond to that setting, although browser zoom still works. Using rem for type, and checking layouts at larger root sizes, is a simple way to meet the requirement.

Letter spacing from design tools

Design tools express tracking relative to the font size. Adobe applications use thousandths of an em, so tracking of 50 is 0.05em, and Figma's percentage letter spacing is the same idea (5% is 0.05em). Writing letter-spacing in em in CSS keeps it proportional when the font size changes; the converter also shows the pixel value for the current size.

More questions

Should I use rem for everything, including padding and borders?

Many teams use rem for font sizes and spacing so the whole layout scales with the reader's font setting, and keep px for hairline borders and shadows, which should stay thin. Media queries in em or rem also respond to the font setting. There's no single rule; consistency within a project matters most.

Why do my rem values look wrong inside a component library?

rem always follows the html element's font size. If your site changes it (the 62.5% trick, or a responsive root size), any library that assumed 16px will scale with it. Check the computed font size of the html element in your browser's developer tools and enter it as the root font size here.

What is a pica?

A pica is 12 points, or one sixth of an inch, the unit typographers and newspaper designers use for column widths and line lengths. In CSS, 1pc = 16px. A 30-pica column is 5 inches wide.

What is the Q unit?

Q is a quarter of a millimetre (0.25 mm), taken from Japanese typesetting, where type sizes are measured in Q. CSS added it so print style sheets can use it. 10mm = 40Q, and 1Q is about 0.945px.

Are pt and px the same in Photoshop or Illustrator?

In a document set to 72 pixels per inch they are: one point equals one pixel. That is why many design tools treat them as interchangeable. At 300 pixels per inch for print, one point is about 4.17 pixels. Choose device pixels and enter your document's resolution to convert.

Sources

This article explains how the calculator works and is general information, not financial, tax, legal or medical advice. Rules change; check the sources above or a qualified professional before you act.

Spotted a wrong result or a bug? Report a problem

May we count your visits with Invoker Analytics? It keeps a random visitor number in your browser. Your calculator inputs are never sent. Privacy policy