Pixel converter

Pixels to inches, cm, pt, rem and em, for CSS, for print, or measured on your screen.

96 px to the inch, fixed by the CSS spec. rem, em and vw live here.

Type a unit with the number if you like: 24px, 1.5rem, 8.5in.

  • rem

    1.5rem

    24px ÷ 16 = 1.5rem (16px root size)

  • em

    1.5em

    24px ÷ 16 = 1.5em (16px parent size)

  • points

    18pt

    24px ÷ 1.3333 = 18pt (96 px per inch ÷ 72)

  • inches

    0.25in

    24px ÷ 96 = 0.25in (96 px per inch)

  • centimetres

    0.635cm

    24px ÷ 37.7953 = 0.635cm (96 px per inch ÷ 2.54)

  • millimetres

    6.35mm

    24px ÷ 3.7795 = 6.35mm (96 px per inch ÷ 25.4)

  • picas

    1.5pc

    24px ÷ 16 = 1.5pc (96 px per inch ÷ 6)

  • viewport width

    1.6667vw

    24px ÷ 14.4 = 1.6667vw (1440px viewport ÷ 100)

What pixel converter is

A calculator that turns a length in pixels into inches, centimetres, millimetres, points, picas, rem, em or viewport width, and back again. This one first asks what the pixels are for, because a CSS pixel, an image pixel on paper and a pixel on your own screen each have a different inch.

What this tool does that others do not

  • It asks what the pixels are for

    For CSS, an inch is 96 pixels by definition. For print, it is whatever resolution the file is printed at. On a screen, it is whatever the hardware makes it. Most converters pick one of these silently and give the other two groups of visitors a wrong answer.

    The same 3000 pixels are 31.25 CSS inches, 10 inches printed at 300 ppi and 20 inches printed at 150 ppi.

  • It measures a real inch on your screen

    Hold a bank card against the display and adjust a rectangle until the edges meet. From then on, On this screen gives physical lengths, draws a centimetre ruler at true size, and warns you if browser zoom has changed since you measured.

    Bank and ID cards are 85.60 × 53.98 mm under ISO/IEC 7810. No browser interface reports a display’s physical size, so a known object is the only honest reference.

  • Every result shows its arithmetic

    Under each value is the sum that produced it, with the basis named: the root size for rem, the parent size for em, the resolution for print. A wrong assumption is visible at a glance instead of buried in a number.

    24px at a 16px root reads "24px ÷ 16 = 1.5rem (16px root size)".

  • Print sizes in whole pixels

    Choose print and a paper table appears at your resolution, already rounded, because a file cannot contain part of a pixel and the half-pixel is where most quoted figures disagree.

    At 300 ppi: A4 2480 × 3508, A5 1748 × 2480, US Letter 2550 × 3300.

How to use it

  1. Say what the pixels are for

    CSS for anything going into a stylesheet or a design tool, print for an image headed to paper, and this screen when you want to know how big something physically looks on your display.

  2. Type the size, with its unit if you like

    A bare number uses the unit beside it. Typing 24px, 8.5in or 1.5rem in full sets the unit for you.

  3. Set the one thing the answer depends on

    The root size for rem, the parent size for em, the viewport width for vw, or the resolution for print. Each only appears when it matters.

  4. Copy the value you need

    Every result copies with its unit attached, ready to paste into CSS or a print brief.

Worked examples

Real input, real figures.

A spacing value from a design file, into rem

You give it

24px, on a site with the default 16px root and on one that sets html { font-size: 62.5% }.

You get

1.5rem at the 16px root and 2.4rem at the 10px one. The converter uses whichever root you give it, which is the whole difference between a correct conversion and a 60% error.

How big a phone photo prints

You give it

A 4032 × 3024 pixel photo, printed at 300 ppi.

You get

13.44 × 10.08 inches, or 34.14 × 25.6 cm. At 150 ppi the same file covers 26.88 × 20.16 inches, with the same pixels spread twice as far.

Against a typical px converter

AspectThis toolA typical converter
What a pixel meansYou choose: CSS, print or this screenOne assumption, usually unstated
Unitspx, in, cm, mm, pt, pc, rem, em and vw at onceOne pair per page
WorkingThe arithmetic under every valueA bare number
Real size on screenMeasured against a bank cardNot attempted
PrintWhole pixels for A4, A3, A5, Letter, Legal and 4 × 6Inches only

Guide

What it will not do

  • It cannot know your screen’s physical size without the card. Browsers do not expose it, so On this screen shows CSS inches until you measure.
  • It does not resample images. To change an image’s pixel dimensions, use the image editor; this tool tells you the size those pixels will print at.
  • em is answered for the parent size you enter. It cannot see your page, so if an ancestor sets a font size, read the computed value in your browser’s developer tools and enter that.

Every unit, in one line

pxPixel
1/96 of a CSS inch. In print, 1/ppi of a real inch for an image.
inInch
96 CSS pixels, or 2.54 centimetres.
cmCentimetre
37.7953 CSS pixels.
mmMillimetre
3.7795 CSS pixels; a tenth of a centimetre.
ptPoint
1/72 of an inch, so 4/3 of a CSS pixel. 12pt is 16px.
pcPica
12 points, a sixth of an inch, 16 CSS pixels.
remRoot em
The root element’s font size: 16px unless the site or the visitor changes it.
emEm
The font size of the element itself, or of its parent when setting font-size. Compounds when nested.
vwViewport width
1% of the viewport’s width, so 14.4px on a 1440px-wide window.

Questions people ask

Straight answers. Each one links directly: copy the address after opening it.

Why do different converters give different answers?

Because they assume different meanings of pixel. One divides by 96 (the CSS inch), another by 72 (the old Macintosh screen), another by 300 (a print resolution). All three are right for something. This tool makes you say which one you mean.

Which unit should I use for font sizes on a website?

Rem. It follows the visitor’s font-size setting, which px and pt do not, and unlike em it does not compound when elements are nested. Keep px for borders and hairlines that should stay thin.

Can a web page show something at its real physical size?

Not on its own. CSS inches are fixed to pixels on screen, and browsers do not report how big the screen physically is. Measuring against a bank card, as this tool does, is the reliable way, and it holds until the browser zoom changes.

Is anything I type sent anywhere?

No. The arithmetic runs in this tab. The screen measurement is kept in this browser’s own storage so you do not have to repeat it, and never leaves your device.

Single conversions

Each converts both ways, with reference tables.