HomePhotography & Optics › Megapixels to Print Size Calculator

Megapixels to Print Size Calculator

Computes the megapixel count and aspect ratio of an image from its pixel dimensions and the print size it yields at a chosen resolution in dots per inch, with a table for 150, 200, 240 and 300 dpi.

When to use

You want to know how large a photo can be printed at a given quality, or how many megapixels a camera needs for a print size.

Do not use when: You need a screen's pixel density (use screen-ppi) or the storage size of the image file (use image-file-size).

Formula

megapixels = width_px × height_px / 10⁶; print_width_in = width_px / dpi; print_height_in = height_px / dpi; cm = in × 2.54

Assumes no cropping or resampling; 300 dpi corresponds to the eye's resolution at about 25–30 cm viewing distance, and large prints viewed from farther away look sharp at 150–200 dpi.

Inputs

ParameterTypeUnitRequiredDescription
width_pxintegerpxyesImage width in pixels. Range: ≥ 1, ≤ 1000000
height_pxintegerpxyesImage height in pixels. Range: ≥ 1, ≤ 1000000
dpinumberdpidefault 300Pixels per inch of the print: 300 for gallery quality, 240 for typical inkjet, 150 for large prints viewed from a distance. Range: ≥ 10, ≤ 4800

Outputs

OutputTypeUnitDescription
megapixelsnumberMPwidth_px × height_px / 1 000 000.
print_width_innumberinwidth_px / dpi.
print_height_innumberinheight_px / dpi.
print_width_cmnumbercmPrint width × 2.54.
print_height_cmnumbercmPrint height × 2.54.
aspect_ratiostringReduced width:height ratio, e.g. '3:2' or '4:3'; unusual sizes also show the nearest common ratio, e.g. '376:251 (≈ 3:2)'.
aspect_ratio_decimalnumberwidth_px / height_px.
sizes_tableobjectPrint width × height in inches at 150, 200, 240 and 300 dpi.

Example

24 MP (6000 × 4000) at 300 dpi: {"width_px":6000,"height_px":4000,"dpi":300}{"megapixels":24,"print_width_in":20,"print_height_in":13.33,"print_width_cm":50.8,"print_height_cm":33.87,"aspect_ratio":"3:2"}

12 MP phone (4032 × 3024) at 240 dpi: {"width_px":4032,"height_px":3024,"dpi":240}{"megapixels":12.19,"print_width_in":16.8,"print_height_in":12.6,"aspect_ratio":"4:3"}

GET https://tttkmbb.com/api/v1/calculate/megapixels-print-size?width_px=6000&height_px=4000&dpi=300

Machine access

Sources

FAQ

Is dpi the same as ppi?

For this calculation yes: it is the number of image pixels per inch of print. Printer 'dpi' figures like 1440 or 2880 refer to ink droplets and are not the image resolution.

Can I print larger than the 300 dpi size?

Yes, resolution only needs to match viewing distance: a print viewed from 1 m looks sharp at about 100 dpi, so a 24 MP file makes a 60 × 40 in print for wall viewing.

Related calculators