Pixels to MB: How to Calculate Image File Size (Formula, Chart and Calculator) - The Digital Clutter

Pixels to MB: How to Calculate Image File Size (Formula, Chart and Calculator)

You have a photo that is 4000 by 3000 pixels and you need to know how many megabytes it will take. Or you have an upload limit of 2 MB and need to know what pixel size will fit. The conversion from pixels to MB is one of the most searched questions in photography, web design, and digital storage, and the honest answer is that it depends on three things: how many pixels there are, how much data each pixel stores, and how well the file is compressed. This guide explains the pixels to MB formula, gives you worked examples, a calculator, reference tables for common photo and screen sizes, and practical ways to hit a target file size.

By the end you will be able to estimate the size of any image before you save it, understand why two images with identical dimensions can differ tenfold in size, and choose the right format and settings for email, websites, social media, and long-term storage.

Quick answer: how do you convert pixels to MB?

Multiply width by height to get total pixels, multiply by the bytes per pixel (3 bytes for standard 24-bit color), then divide by 1,048,576 to get uncompressed megabytes. Example: 4000 x 3000 x 3 / 1,048,576 = about 34.3 MB uncompressed. A JPEG of that photo is usually 2 to 8 MB, because compression shrinks the data by roughly 5 to 20 times.

Pixels, Bits, Bytes and Megabytes Explained

A pixel is a single dot of color. An image is a grid of pixels, so its pixel count is its width multiplied by its height. A megapixel is one million pixels, so a 4000 x 3000 image is 12 megapixels.

Each pixel stores a color. In a standard color image, each pixel has three channels, red, green, and blue, and each channel usually uses 8 bits. That makes 24 bits, or 3 bytes, per pixel. Add a transparency channel and you get 32 bits, or 4 bytes. A grayscale image needs only 1 byte per pixel, and professional or RAW images may use 12 to 16 bits per channel.

A megabyte is where it gets slightly confusing. Computers measure memory in binary units, where 1 MB is 1,048,576 bytes (more precisely called a mebibyte, MiB). Storage manufacturers and many websites use decimal units, where 1 MB is 1,000,000 bytes. The difference is about 4.9 percent, which matters when you are close to a limit. Our guide to the data usage calculator explains the same bits-and-bytes conventions for internet data.

The Pixels to MB Formula

For an uncompressed image, the size is simple:

  • Total pixels = width x height
  • Size in bytes = total pixels x bytes per pixel
  • Size in MB = bytes / 1,048,576 (binary) or bytes / 1,000,000 (decimal)

Worked examples

ImagePixelsBytes per pixelUncompressed size
1920 x 1080 (Full HD screenshot)2,073,6003about 5.9 MB
3840 x 2160 (4K screenshot)8,294,4003about 23.7 MB
4000 x 3000 (12 MP photo)12,000,0003about 34.3 MB
6000 x 4000 (24 MP photo)24,000,0003about 68.7 MB
8000 x 6000 (48 MP photo)48,000,0003about 137.3 MB
1080 x 1080 (social square, with transparency)1,166,4004about 4.4 MB

These are the sizes the image takes in memory or as an uncompressed bitmap. The file you actually save will usually be much smaller.

Why Real File Sizes Are Much Smaller: Compression

Almost every image format compresses the data. There are two families:

  • Lossless compression (PNG, lossless WebP, TIFF with compression) finds patterns and stores them efficiently without changing a single pixel. Flat graphics and screenshots compress very well. Noisy photos compress poorly.
  • Lossy compression (JPEG, lossy WebP, AVIF, HEIC) discards detail the eye is least likely to notice. The smaller you make the file, the more visible the loss.

Because the result depends on image content, there is no exact conversion. But you can use typical ratios to estimate.

Typical compressed size by format

FormatCompressionTypical size vs uncompressedBest for
BMPNone100 percentRarely used today
JPEG at high quality (85-95)Lossyabout 8 to 20 percentPhotos for sharing and printing
JPEG at medium quality (60-75)Lossyabout 3 to 8 percentWeb photos and email
PNGLosslessabout 20 to 60 percent for photos; far less for flat graphicsScreenshots, logos, transparency
WebP (lossy)Lossyabout 2 to 6 percentWebsites
AVIFLossyabout 1 to 4 percentModern websites where supported
HEICLossyabout 2 to 6 percentPhone photos
TIFF (uncompressed)None100 percent or moreArchival and print workflows
RAWVariesoften 20 to 80 MB for 24 MPEditing flexibility

These are rules of thumb, not guarantees. A photo of a clear sky compresses far more than a photo of a gravel path or a field of grass.

Pixels to MB Calculator

Enter your image dimensions and choose a format to see the uncompressed size and an estimated compressed range.

Image File Size Calculator

Width (px): Height (px):

Color depth:

Format:

Units:

MB to Pixels: Working Backward From a Size Limit

Often you start with a limit, such as 2 MB for a form upload, and want to know what dimensions will fit. Reverse the logic:

  1. Convert the limit to bytes (2 MB = 2,097,152 bytes in binary units).
  2. Estimate the compression ratio for your format. For a medium-quality JPEG, assume the file will be about 6 percent of uncompressed size.
  3. Divide the limit by the compression ratio to get the uncompressed size you can afford: 2,097,152 / 0.06 = about 34.9 million bytes.
  4. Divide by bytes per pixel (3): about 11.6 million pixels.
  5. That is roughly 4000 x 2900, so a 12 MP photo at medium JPEG quality should land near the limit.

This is an estimate. Always check the real file and adjust the quality slider or dimensions until it is comfortably under the limit.

Image Sizes for Common Uses

UseRecommended pixel sizeTarget file size
Website hero image1920 x 1080 or up to 2560 wideunder 200 KB with WebP or AVIF; under 400 KB with JPEG
Blog content image1200 to 1600 wideunder 150 KB
Thumbnail300 to 600 wideunder 40 KB
Email attachment photo1600 to 2000 wide0.5 to 1.5 MB
Social media post1080 wideunder 1 MB
Passport or ID upload (often)600 x 600 or as specifiedoften 100 KB to 2 MB; follow the form
Print 4 x 6 inches at 300 PPI1200 x 18000.5 to 2 MB
Print 8 x 10 inches at 300 PPI2400 x 30002 to 6 MB
Poster 18 x 24 inches at 150 PPI2700 x 36004 to 12 MB

Always follow the exact requirements of the site or service you are uploading to, since limits change.

Pixels, DPI and PPI: What They Do and Do Not Change

One common misunderstanding is that DPI or PPI changes the file size. It does not. PPI (pixels per inch) is only a label that tells a printer or layout program how large to print the same pixels. A 3000 x 2000 image has the same pixels and the same file size whether it is tagged 72 PPI or 300 PPI. What changes the file size is the pixel count, the color depth, and the compression.

To work out the pixels you need for a print, multiply the print size in inches by the target PPI. For a sharp 8 x 10 inch print at 300 PPI, you need 2400 x 3000 pixels. For wall-sized posters viewed from a distance, 100 to 150 PPI can look fine.

Why Two Images With the Same Dimensions Have Different Sizes

  • Detail and noise. Textured, grainy, or high-ISO photos have more information to store.
  • Quality setting. JPEG quality 95 can be three to four times larger than quality 70.
  • Format. PNG, JPEG, WebP, and AVIF handle the same picture very differently.
  • Metadata. EXIF, thumbnails, color profiles, and edit history add size, sometimes hundreds of kilobytes.
  • Color depth and alpha channel. A transparent PNG stores an extra channel.
  • Chroma subsampling and progressive encoding. These JPEG options change size slightly.

How to Reduce Image File Size Without Ruining It

  1. Resize first. Cutting the dimensions is the biggest saving. Halving width and height cuts the pixel count to a quarter.
  2. Choose the right format. Use JPEG, WebP, or AVIF for photos, and PNG or lossless WebP for logos, screenshots, and transparency.
  3. Lower the quality gently. Quality 75 to 85 is usually visually indistinguishable for web use. Zoom in to check for blocky artifacts around edges.
  4. Strip metadata. Remove unneeded EXIF data and embedded thumbnails, but keep copyright details if you need them.
  5. Crop. Remove edges and empty space.
  6. Use progressive or optimized encoding. Many tools offer this as a checkbox.
  7. Do not recompress repeatedly. Each lossy save degrades quality. Keep an original and export copies from it.

Free ways to shrink images

  • The built-in Photos app or Preview can resize and export at a chosen quality.
  • Browser-based tools such as Squoosh let you compare formats side by side.
  • Free editors like GIMP offer detailed export controls.
  • WordPress plugins can compress images automatically on upload, which also helps your page speed.

How Image Size Affects Storage and Backups

If you take thousands of photos, file sizes add up fast. A 12 MP phone photo at about 3 MB means roughly 330 photos per GB, or about 330,000 photos in a terabyte. Shooting RAW at 30 MB each reduces that to about 33,000. Use our guide to how much storage you need to plan capacity, and the phone storage calculator to see how many photos your phone can hold. If your cloud storage keeps filling up, see our fix guide for iCloud storage full.

When you move large photo libraries, the file transfer time calculator shows how long a copy or upload will take. And to keep your photo folders tidy as they grow, follow our file naming conventions and learn how to declutter your computer.

Image Size and Website Speed

For website owners, image weight is often the largest part of a page. Large images slow loading, hurt mobile users, and can reduce search performance. Good practice includes:

  • Serve images no larger than they appear on screen, and use responsive image sizes.
  • Use modern formats such as WebP or AVIF where supported, with a JPEG fallback if needed.
  • Lazy-load images below the fold.
  • Set width and height attributes to avoid layout shifts.
  • Write descriptive file names and alt text, which help accessibility and image search.

Common Mistakes

MistakeResultFix
Uploading straight from a camera or phoneHuge files that slow pages and exceed limitsResize to the needed dimensions first
Saving photos as PNGFiles several times larger than JPEGUse JPEG, WebP, or AVIF for photos
Changing DPI to shrink a fileNo change in sizeReduce pixel dimensions or quality instead
Confusing MB and MbOff by a factor of eightCapital B is bytes, lowercase b is bits
Over-compressingBlocky, blurry imagesUse quality 75 or above for most images
Editing the same JPEG over and overProgressive quality lossKeep a master copy and export from it

Practice Questions: Pixels to MB in Real Situations

Example 1: Will my phone photo fit a 5 MB upload limit?

Your phone shoots 4032 x 3024 pixels, which is about 12.2 megapixels. Uncompressed, that is 4032 x 3024 x 3 / 1,048,576, or roughly 34.9 MB. Phone JPEG and HEIC files typically save at 1.5 to 4 MB, so it should fit comfortably. If the file still comes out near the limit, export it at 3000 pixels wide and quality 80, which cuts the pixel count by almost half.

Example 2: How big is a 4K screenshot saved as PNG?

A 3840 x 2160 screenshot is 8,294,400 pixels, or about 23.7 MB uncompressed. Screenshots contain flat colors and text, which PNG compresses very well, so the saved file is often 1 to 4 MB. A screenshot of a busy photo or video frame will be larger, perhaps 8 to 12 MB.

Example 3: What resolution do I need for a 600 KB blog image?

Work backward. 600 KB is about 614,400 bytes. At WebP compression of roughly 4 percent, the uncompressed size can be around 15.4 million bytes, which is about 5.1 million pixels. That is more than 2500 x 2000, so a 1600 x 900 blog image will fit with room to spare, often under 100 KB.

Example 4: How many photos fit on a 128 GB phone?

If each photo averages 3 MB, 128 GB holds about 42,000 photos in theory. Real capacity is lower because the operating system, apps, and videos use space too. If you shoot 4K video, remember that video takes far more room than photos. Our video file size calculator shows how quickly it grows.

Example 5: How does cropping change size?

Cropping a 6000 x 4000 photo to 3000 x 2000 removes three quarters of the pixels. The uncompressed size drops from about 68.7 MB to about 17.2 MB, and the saved JPEG shrinks by a similar proportion. Cropping is a free way to cut size when the edges of the picture add nothing.

Quick Mental Math for Image Sizes

  • One megapixel is about 3 MB uncompressed at 24-bit color.
  • A good JPEG is typically 0.1 to 0.5 MB per megapixel.
  • Doubling the width and height quadruples the pixel count and roughly quadruples the file size.
  • Going from quality 95 to quality 80 often cuts a JPEG by half or more with little visible change.
  • Lossless PNG screenshots are often under 1 MB per megapixel; photos in PNG can be 2 to 6 MB per megapixel.

Putting It Together: Worked Examples

Example 1: Will my photos fit on a 256 GB USB drive?

  • 12,000 smartphone photos × 4 MB = 48 GB
  • 30 minutes of 4K family video × 350 MB = 10.5 GB
  • Total ≈ 58.5 GB → fits easily on 256 GB, with room to grow.

Example 2: How much cloud storage do I need?

Add everything you want backed up, then add 30% headroom: Photos 40 GB + Videos 25 GB + Documents 5 GB = 70 GB. 70 GB × 1.3 = 91 GB → a 100 GB or 200 GB plan covers it. No need to pay for 2 TB.

Example 3: Can I download this course for offline viewing?

  • 40 lessons × 20 minutes each = 800 minutes
  • At 720p: 800 × 60 MB = 48 GB → check your free space first!

Example 4: Phone storage check

Use these same numbers on your phone: count your photos and videos (your gallery app shows totals), multiply, and compare against free space. For a phone-specific walkthrough with app and system estimates, see our phone storage calculator guide.

Common File Size Calculator Mistakes

Mixing up MB and GB. A thousand-fold error. Always label your units when doing the math.

Forgetting the system overhead. Phones and computers reserve 10–20 GB for the OS. A “128 GB” phone never has 128 GB available.

Ignoring “Other” / cached data. Apps, thumbnails, and caches inflate real usage 20–40% above your file estimates. Add a buffer.

Trusting the drive label. As noted above, a 1 TB drive formats to ~931 GB. External drives and SD cards are the same story.

Underestimating video. Everyone does. One hour of 4K can outweigh 5,000 photos. When in doubt, assume video dominates.

Key Takeaways

  • Uncompressed size = width x height x bytes per pixel, divided by 1,048,576 for MB.
  • Real files are much smaller because of compression, typically 5 to 50 times smaller for photos.
  • Resizing the pixel dimensions is the most effective way to cut file size.
  • PPI and DPI do not change file size, only how large the image prints.
  • Use JPEG, WebP, or AVIF for photos, and PNG for graphics and transparency.
  • Always test the exported file, since content and settings affect the result.

With the formula, the reference tables, and the calculator above, you can predict an image’s size before you export it and pick the right balance of dimensions, format, and quality for the job. Keep your original files, export optimized copies, and you will never be surprised by an upload limit again.

Frequently Asked Questions

How do I convert pixels to MB?

Multiply width by height, multiply by the bytes per pixel (3 for standard 24-bit color), and divide by 1,048,576. For example, 4000 x 3000 x 3 / 1,048,576 is about 34.3 MB uncompressed. Compression then reduces the saved file.

How many MB is a 12 megapixel photo?

Uncompressed, a 12 MP image is about 34 MB. As a JPEG it is usually between 2 and 8 MB, depending on quality and detail. HEIC and WebP versions are often smaller.

How many pixels is 1 MB?

It depends on compression. Uncompressed 24-bit, 1 MB holds about 350,000 pixels. As a medium-quality JPEG, 1 MB can hold roughly 5 to 10 million pixels depending on the image.

Does DPI affect file size?

No. DPI and PPI only describe how large an image prints. File size depends on the pixel dimensions, color depth, format, and compression.

Why is my PNG so much bigger than a JPEG?

PNG is lossless, so it keeps every pixel exactly. Photos have lots of fine detail that lossless compression cannot shrink much, while JPEG discards detail the eye barely notices.

What is the difference between MB and Mb?

Capital B means bytes and lowercase b means bits. There are 8 bits in a byte, so 8 Mb equals 1 MB. File sizes use MB, while internet speeds are usually in Mbps.

How can I make an image under 1 MB?

Resize it to the dimensions you need, export as JPEG or WebP at quality 70 to 85, and remove metadata. If it is still too big, crop it or reduce the dimensions further.

What image size is best for a website?

Most blog images work well at 1200 to 1600 pixels wide and under 150 KB, using WebP or compressed JPEG. Hero images can be 1920 to 2560 wide, ideally under 200 to 400 KB.

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *