Megapixel Calculator

Calculate pixel count or estimate dimensions for a target megapixel count.

Enter your values

Image dimensions

Whole pixels from 1 to 1,000,000.

Enter your values to calculate.

Result

Your result will appear here.

Calculate megapixels or pixel dimensions

A megapixel (MP) is one million pixels. Use this calculator when you know the numbers rather than having to open an image file.

  • Megapixels from dimensions: Enter Width (px) and Height (px), then select Calculate. For 6000 × 4000 px, the result is 24 MP, with 24,000,000 total pixels and a 3:2 aspect ratio.
  • Dimensions from megapixels: Enter the target Megapixels (MP), Ratio width and Ratio height, then select Calculate. For 24 MP with a ratio of 3:2, enter 24, 3 and 2 to get 6000 × 4000 px.

In the second mode, the result is an estimate in whole pixels. Read Actual megapixels, Total pixels and Actual ratio beneath the dimensions before using them. The achieved values may differ from the requested ones.

If you don’t know the dimensions of an existing image, use the image dimensions checker for a supported still JPEG, PNG or WebP. Its file limit is 20 MiB, and its image limits are 4096 px per side and 8 million pixels overall. For a larger original or an unsupported format, obtain the pixel dimensions of the unchanged file from a compatible local viewer or its file properties, then enter them here.

The megapixel formulas

Count the pixels across the image and down the image, not the physical dimensions in inches or centimeters.

Megapixels = width × height ÷ 1,000,000

The divisor is exactly one million, not 1,048,576; NIST’s SI prefix reference defines mega as a factor of 10 to the sixth power.

To work backward from a target of M megapixels and an aspect ratio a:b (width to height), first set N = M × 1,000,000. The ideal dimensions before rounding are:

  • Width = √(N × a ÷ b)
  • Height = √(N × b ÷ a)

Both roots are rounded separately to whole pixels. A 12 MP image could be 4000 × 3000 px (4:3) or 6000 × 2000 px (3:1). The area is identical, but the shape is different. To plan a portrait, enter the smaller ratio part first if you want the height to exceed the width. For a decimal ratio such as 1.5:1, enter 3 and 2 instead.

If you already have a required width or height rather than a ratio, divide N by that known dimension to find the ideal missing side. For example, 12 MP at a fixed width of 4000 px requires 3000 px high. If the quotient is fractional, round up for a minimum pixel count or down for a maximum, then check the actual area using Megapixels from dimensions.

When a minimum or maximum MP matters

Suppose a submission requires exactly 16:9 and no more than 12 MP. Enter 12 MP with ratio parts 16 and 9 in Dimensions from megapixels. The estimated result is 4619 × 2598 px. Its pixel count is 12,000,162, so it exceeds the maximum by 162 pixels, and its ratio is not exactly 16:9.

You can keep the exact shape by using whole multiples of its reduced ratio. For 16:9, each valid size is 16k × 9k px for a positive whole number k.

Dimensions Actual MP
4619 × 2598 (rounded estimate) 12.000162
4608 × 2592 (16:9, k = 288) 11.943936
4624 × 2601 (16:9, k = 289) 12.027024

Use 4608 × 2592 for a strict 12 MP maximum and 4624 × 2601 for a strict 12 MP minimum, if the destination allows those dimensions. Neither is exactly 12 MP.

For another target, reduce the ratio to whole-number parts a and b, using the aspect ratio calculator if necessary. Compute √(N ÷ (a × b)). Round this multiplier down for a maximum or up for a minimum. If there are also maximum dimensions, divide the allowed width by a and the allowed height by b, rounding each quotient down. The smaller of those two integers is the largest multiplier that fits the size limits. For a maximum MP, use the smaller of that integer and the MP-based maximum. For a minimum MP, the rounded-up multiplier must not exceed that size limit. Multiply both ratio parts by the chosen positive integer. If no positive multiplier satisfies all the constraints, there is no valid exact-ratio size. An exact match to both target MP and ratio requires the unrounded MP-based multiplier itself to be a whole number that fits the limits.

Enter the selected dimensions in Megapixels from dimensions to verify the area and ratio. If a destination specifies a limit in pixels, compare Total pixels directly with that limit, rather than rounding the MP result to fewer decimal places.

Common pixel dimensions and megapixel counts

These values are calculated from the stated grids. A resolution label or camera rating alone is not a precise pixel count.

Pixel dimensions Megapixels
1000 × 1000 1
1280 × 720 (720p) 0.9216
1920 × 1080 (1080p) 2.0736
2560 × 1440 3.6864
3840 × 2160 (4K UHD) 8.2944
4096 × 2160 8.84736
4000 × 3000 12
4032 × 3024 12.192768
6000 × 4000 24
7680 × 4320 (8K UHD) 33.1776

Doubling both sides of a grid quadruples its megapixels: 3840 × 2160 has four times the pixels of 1920 × 1080. At the same aspect ratio, doubling the megapixels only multiplies each ideal side by √2 (about 1.414). Halving both sides of a 6000 × 4000 image produces 3000 × 2000, or 6 MP, not 12 MP.

Why a camera’s advertised megapixels may not match the file

Sensor specifications and recorded image sizes are different measurements. For example, Nikon’s Z6III specifications list 24.5 million effective pixels and 26.79 million total sensor pixels, but a large FX-format still is 6048 × 4032 px, or 24.385536 MP. Its listed large 16:9 still is 6048 × 3400 px, or 20.5632 MP.

If you need to assess an actual file, use its pixel dimensions, not the camera’s rounded rating. For planning a new image from a nominal MP rating, the reverse calculation gives an estimate; it does not identify a specific camera’s output mode.

Do you have enough megapixels for a print?

The total pixel count is useful, but the shape must also fit. A 10 × 8 inch print at 300 pixels per inch (PPI) requires 3000 × 2400 px, or 7.2 MP. For an uncropped image at a chosen PPI, divide the width and height in pixels by that PPI to find the physical size in inches.

Now consider a 3600 × 2000 px image. It also has 7.2 MP, but filling a 10 × 8 inch print without stretching requires a 2500 × 2000 px crop. That leaves 5 MP and gives only 250 PPI. The original MP count alone does not establish that the image meets the print requirement.

Use the pixels to print size calculator in Required pixels mode with 10 and 8 inches and your target PPI to calculate the minimum dimensions. If the photo and paper have different shapes, use the photo print size calculator with the actual image dimensions to compare Fill (crop) and Fit (keep the whole image with margins). Choose the density the printer or recipient requires; 300 PPI is an example target, not a guarantee of sharpness.

What megapixels do not measure

Megapixels count pixels, not compressed file bytes, stored print density or image quality. For example, 24 MP of uncompressed 8-bit RGB pixel samples requires 72,000,000 bytes for the samples alone; a saved file may have a very different size due to its encoding, compression and other data. Changing a PPI setting without resampling leaves the pixel count unchanged. Upsampling may increase the number of pixels without recovering the original missing detail. See Adobe’s image size and resolution reference for the distinction between resolution and resampling.

For a crop, calculate the megapixels of the retained dimensions, not of the original canvas. For an image with padding, the pixel count includes the added border; it does not imply additional photographic detail.

Input limits

Enter positive whole numbers from 1 to 1,000,000 for the pixel dimensions and ratio parts, without commas or unit labels. In reverse mode, enter a positive MP value up to 1,000,000 with at most six decimal places. The smallest input is 0.000001 MP (one pixel). The resulting dimensions must also be between 1 and 1,000,000 px per side.

Very small or extremely wide/tall targets may give an error if a side rounds to zero or exceeds the dimension limit. Even a valid result can differ substantially from a tiny target: 0.000001 MP at 9:4 rounds to 2 × 1 px, or 0.000002 MP. If the result does not satisfy your constraints, try a feasible ratio or adjust the target.

The calculator performs numeric planning in your browser; it does not open, edit or export images. A calculated size is not a promise that an image editor can allocate or process a raster of that size.