Why pixels need a density

A pixel is a count of picture elements, not a length. It has no physical size until a device or a print setting says how many pixels fit in an inch. That number is the pixel density, written as pixels per inch or PPI. Divide the pixel count by the density and you have the length in inches. The default of 3000 pixels at 300 PPI returns 10 inches. Change the density to 150 and the same 3000 pixels span 20 inches, at half the sharpness. The page therefore answers a very specific question: how large will this many pixels be at this density? It can equally be read backward, as the question of what density you get when a known number of pixels must fill a known length, which you find by dividing pixels by inches.

The formula and a check

Inches equal pixels divided by PPI. A width of 1200 pixels at 300 PPI is 4 inches, and 6000 pixels at 300 PPI is 20 inches. A height of 4000 pixels at 300 PPI is 13.333 inches. The calculation covers one dimension, so run it once for width and once for height. To check a result, multiply the inches by the PPI and you should get the pixel count back. Because the formula is a simple division, the result moves inversely with the density: doubling PPI halves the size, and halving PPI doubles it. Fractional results are normal, so 4000 pixels at 300 PPI is 13.333 inches, which design software will usually round to a hundredth of an inch. To get millimeters, multiply the inches by 25.4, which is exact by definition.

Typical densities

Commercial print for sharp photographs and text often targets 300 PPI. Large formats viewed from a distance, such as posters and banners, use 100 to 150 PPI or less. Desktop screens have long been described as 72 or 96 PPI. The CSS reference pixel is defined as 1/96 of an inch, and the PostScript point is 1/72 of an inch, so 1080 pixels at 72 PPI is 15 inches, while 1920 pixels at 96 PPI is 20 inches. Modern phones and laptops have much higher real densities, often several hundred PPI, so a screen's actual size is not given by those traditional numbers.

Paper sizes in pixels

To prepare an image for a sheet of paper, work backward from the inches. A4 is 8.27 by 11.69 inches, which at 300 PPI needs about 2480 by 3508 pixels. Going the other direction, 2480 pixels at 300 PPI is 8.267 inches, and 3508 pixels is 11.693 inches. For a 4 by 6 inch print at 300 PPI you need 1200 by 1800 pixels. If your image is smaller than the target, either accept a lower density, which looks softer, or resample, which invents pixels rather than adding detail. Plan the pixel dimensions before you shoot or export, and the print size follows. For a 5 by 7 inch print at 300 PPI the target is 1500 by 2100 pixels, and a file of 1000 by 1400 pixels would reach only 200 PPI at that size, a difference that is noticeable in fine detail.

Camera files at print sizes

A 24 megapixel camera produces 6000 by 4000 pixel files. At 300 PPI that prints at 20 by 13.33 inches, and at 200 PPI at 30 by 20 inches. A 4500 pixel dimension at 240 PPI is 18.75 inches. Many photographers find 240 to 300 PPI sufficient for prints viewed at arm's length. Cropping a file removes pixels, so the printable size at a given density shrinks with it. Check the pixel dimensions of the cropped file, not the original, before ordering a large print. The megapixel calculator on this site turns the two dimensions into a total count.

PPI, DPI and what a printer does

PPI refers to pixels in the image, and DPI refers to the dots of ink or toner a printer lays down per inch. The two are related, but they are not the same. A printer builds each image pixel from many tiny dots, and its DPI can be much higher than the PPI of the file. Software labels these inconsistently, so a dialog that asks for DPI when you resize an image often means PPI. The conversion on this page uses PPI only. It does not know about printer resolution, halftoning or screening.

Metadata is a label, not a size

Image files can store a PPI value in their metadata, commonly 72 or 300. That value does not change the pixels in the file. It only suggests a print size when you place the file in a layout program. Changing the metadata from 72 to 300 PPI turns a 3000 pixel width from 41.67 inches into 10 inches without altering a single pixel. This is why a file can look huge at one setting and small at another. The pixels are what limit quality, and the density you choose decides the size at which they will look sharp.

Matching width and height

To get a physical width and height, convert each pixel dimension with the same PPI. That preserves the aspect ratio of the image, provided you do not crop it. Using different densities for the two dimensions stretches the picture. When placing an image into a frame of a different shape, crop first, then compute the size from the pixels remaining. If the frame aspect ratio differs from the image, either the sides or the top and bottom must be cut, so decide which edge to lose before computing. To fill a 5:4 frame from a 6000 by 4000 image, keep the full 4000 pixel height and crop the width to 5000 pixels, which gives 16.667 by 13.333 inches at 300 PPI.

Why pixel density does not fix image quality

The page divides a pixel count by a density and returns one length. It does not resample, sharpen or crop images, and it does not determine the actual pixel density of a screen or printer. It treats the density you enter as a given. The result must be finite, so a density of zero is not valid. For software-specific behavior when you resize an image, such as how a program handles resolution and resampling, the Adobe help pages on image size describe the relationship between pixel dimensions, resolution and document size.