Megapixel calculator

Enter the width and height in pixels to get megapixels, or enter megapixels and an aspect ratio to get the pixel size. The print sizes show how large the picture can go at three common densities.

I know
px
px
Print size in
Megapixels24 MP
Width6,000 px
Height4,000 px
Print width at 300 ppi
20 in
Print height at 300 ppi
13.3 in
Print width at 240 ppi
25 in
Print height at 240 ppi
16.7 in
Print width at 150 ppi
40 in
Print height at 150 ppi
26.7 in

Runs in your browser: nothing you enter is sent anywhere.

How to use it

  1. Choose what you know: the pixel size or the megapixel count.
  2. For megapixels, pick the aspect ratio of the image.
  3. Read the megapixels or pixel size, and the print size at 300, 240 and 150 ppi in inches or centimetres.

How it works

Megapixels = width × height ÷ 1,000,000. From a megapixel count and an aspect ratio a:b, the width is √(MP × 10⁶ × a ÷ b) and the height is width × b ÷ a, each rounded to whole pixels. Print size is the pixel count divided by the pixels per inch; one inch is 2.54 cm.

Worked example

24 MP at 3:2: width = √(24,000,000 × 1.5) = 6000 and height = 4000. At 300 ppi that prints at 20 × 13.3 in (50.8 × 33.9 cm); at 150 ppi it reaches 40 × 26.7 in.

Tips

  • The print size needed to hang a picture on a wall depends on viewing distance more than on the pixel count.
  • For exact print requirements by size, use the print size calculator.

Frequently asked questions

How are megapixels calculated?

Multiply the width by the height in pixels and divide by one million. A 6000 × 4000 image has 24 million pixels, so 24 MP.

Why is the pixel size rounded from megapixels?

Camera makers quote rounded megapixels, and the ratio may not divide the total exactly. The calculator rounds each side to a whole pixel, so a real camera can differ by a few pixels.

Which print density should I choose?

300 ppi is the usual standard for sharp prints viewed up close, 240 ppi is still good for most photos, and 150 ppi suits large posters viewed from a distance. These are common guidelines rather than strict limits.

Is a higher megapixel count always better?

Not necessarily. More pixels allow larger prints and cropping, but lens quality, sensor size and noise matter as much for how the picture looks.

More in Images

All tools in this category: Images ·Updated November 3, 2026

Privacy choices

Google Analytics shows us which tools are used and whether they work. It may set cookies. Your choice is kept in this browser.