# 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.

- Calculator id: `megapixels-print-size` · Category: Photography & Optics (`photography`) · Tool name: `calculate_print_size_from_megapixels`
- Canonical page: https://tttkmbb.com/photography/megapixels-print-size · This document: https://tttkmbb.com/photography/megapixels-print-size.md · JSON definition: https://tttkmbb.com/photography/megapixels-print-size.json

## Purpose

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.

**Use when:** 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).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `width_px` | integer | px | required | Image width in pixels. (min 1, max 1000000) |
| `height_px` | integer | px | required | Image height in pixels. (min 1, max 1000000) |
| `dpi` | number | dpi | optional, default 300 | Pixels per inch of the print: 300 for gallery quality, 240 for typical inkjet, 150 for large prints viewed from a distance. (min 10, max 4800) |

## Output

| Field | 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. |

## 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.

## Data Sources

- Wikipedia – Dots per inch — https://en.wikipedia.org/wiki/Dots_per_inch (reference, retrieved 2026-09-24)
- Wikipedia – Image resolution — https://en.wikipedia.org/wiki/Image_resolution (reference, retrieved 2026-09-24)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/megapixels-print-size?width_px=…&height_px=…`
- `POST https://tttkmbb.com/api/v1/calculate/megapixels-print-size` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/megapixels-print-size · OpenAPI operationId `calculate_print_size_from_megapixels` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "megapixels-print-size", "inputs": {…}}`

## Example

- 24 MP (6000 × 4000) at 300 dpi: inputs `{"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: inputs `{"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
```

## Limitations

You need a screen's pixel density (use screen-ppi) or the storage size of the image file (use image-file-size). 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. All values are computed from the formula above; no measurement or live data is involved.

## 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

- [Screen PPI Calculator](https://tttkmbb.com/everyday/screen-ppi.md) — Pixel density of a display from its resolution and diagonal.
- [Aspect Ratio Calculator](https://tttkmbb.com/everyday/aspect-ratio.md) — Aspect-ratio arithmetic for resizing and cropping.
- [Image File Size Calculator](https://tttkmbb.com/photography/image-file-size.md) — Storage size of the same image.
