Home › Photography & 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
| Parameter | Type | Unit | Required | Description |
|---|---|---|---|---|
width_px | integer | px | yes | Image width in pixels. Range: ≥ 1, ≤ 1000000 |
height_px | integer | px | yes | Image height in pixels. Range: ≥ 1, ≤ 1000000 |
dpi | number | dpi | default 300 | Pixels 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
| Output | Type | Unit | Description |
|---|---|---|---|
megapixels | number | MP | width_px × height_px / 1 000 000. |
print_width_in | number | in | width_px / dpi. |
print_height_in | number | in | height_px / dpi. |
print_width_cm | number | cm | Print width × 2.54. |
print_height_cm | number | cm | Print height × 2.54. |
aspect_ratio | string | Reduced 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_decimal | number | width_px / height_px. | |
sizes_table | object | Print 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
- API:
GET https://tttkmbb.com/api/v1/calculate/megapixels-print-size(query parameters) orPOSTwith a JSON body{"inputs": {...}} - Schema: https://tttkmbb.com/api/v1/calculators/megapixels-print-size · Markdown: https://tttkmbb.com/photography/megapixels-print-size.md · JSON definition: https://tttkmbb.com/photography/megapixels-print-size.json
- MCP: server
https://tttkmbb.com/mcp, toolrun_calculator with calculator_id="megapixels-print-size" - OpenAPI operationId:
calculate_print_size_from_megapixels - Freshness:
static. Authentication: none. Rate limit: fair use (see rate limits).
Sources
- Wikipedia – Dots per inch (reference)
- Wikipedia – Image resolution (reference)
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
- Screen PPI Calculator — Pixel density of a display from its resolution and diagonal.
- Aspect Ratio Calculator — Aspect-ratio arithmetic for resizing and cropping.
- Image File Size Calculator — Storage size of the same image.