Pixels and bytes answer different questions
Image dimensions describe a grid: width × height. File size describes how many bytes the stored file contains. The W3C File API defines a Blob or File size as a byte count. [1] The browser exposes an image's intrinsic dimensions through naturalWidth and naturalHeight. [2] [3] These measurements belong in separate fields because one does not calculate the other.
A 4000 × 3000 JPEG, PNG, or WebP always starts with the same 12 million decoded pixel positions, but each actual file can store a different number of bytes. Format, image content, compression settings, metadata, and animation can change the byte count. Read the real file instead of estimating KB from width and height.
Calculate pixels, megapixels, and aspect ratio
Multiply width by height to get the pixel count. For 4000 × 3000, the calculation is 4000 × 3000 = 12,000,000 pixels. Divide by 1,000,000 to report 12 MP. This number describes the raster grid, not sharpness, focus, compression quality, or file bytes.
Reduce width:height to get the aspect ratio. Both 4000 and 3000 divide by 1000, so 4000:3000 becomes 4:3. A 1200 × 1800 portrait contains 2.16 MP and reduces to 2:3. The ratio tells you the frame shape; it does not tell you whether the file passes a 500 KB limit.
Treat KB and MB as byte limits, not quality scores
A strict upload may count decimal megabytes or binary mebibytes. NIST lists 1 MB as 1,000,000 bytes and 1 MiB as 1,048,576 bytes. [4] At a displayed limit of 2, those definitions become 2,000,000 and 2,097,152 bytes—a 97,152-byte, or about 4.86%, difference. Follow the destination's own validator when it does not state which unit it uses.
Browsers give imgrove the underlying byte count through the File interface; the KB or MB label is a display conversion. [5] A larger byte count does not prove that an image has more pixels or looks better. A small byte count does not prove that its dimensions meet the required minimum.
Use a four-field upload checklist
Write down four independent rules before editing: accepted format; minimum or maximum bytes; required pixel width, height, or aspect ratio; and DPI only when the destination explicitly asks for it. The DPI versus pixels guide explains why a resolution tag does not add pixels.
If the pixels or ratio are wrong, use Resize by Dimensions and choose whether to crop, fit, stretch, or pad. If the byte count is too high, use Compress Image to KB and inspect the visual result. Resize and compression solve different limits, so verify the downloaded file after both steps.
Verify every accepted file in the final report
Drop up to 30 files into the imgrove Image Size Checker. The visible report shows every accepted file, not only the first result. It lists pixels, megapixels, aspect ratio, orientation, transparency, DPI when readable, byte size, MIME type, and format details. The TXT download keeps the same batch record.
The browser reports the image it can decode. Animated files use the decoded frame rather than a full animation audit, and uncommon metadata can be absent. DNG mode reads a bounded classic TIFF/DNG header but does not decode RAW pixels or prove editor support. Keep the source, compare the final download with the destination rules, and submit only after every field matches.
Image measurements at a glance
| Measurement | What it answers | 4000 × 3000 example |
|---|---|---|
| Pixel dimensions | How many pixel columns and rows the image has | 4000 × 3000 |
| Pixel count | How many decoded pixel positions the grid contains | 12,000,000 |
| Megapixels | Pixel count expressed in millions | 12 MP |
| Aspect ratio | The reduced shape of the width and height | 4:3 |
| File size | How many bytes the actual stored file contains | Read the file; dimensions do not set it |
Check pixels and bytes separately when
- An application form lists both dimension and KB or MB limits
- A batch contains mixed formats or compression levels
- You need to verify the downloaded result rather than the preview
Check another requirement too when
- The destination demands an exact aspect ratio, color profile, or DPI
- An animated file needs frame count, timing, or animation-size review
- A RAW workflow needs real rendering support instead of header values
Measure, resize, and compress
Related imgrove tools
Check every file before upload
Review up to 30 browser-readable images or DNG headers locally. Compare pixels, megapixels, ratio, DPI, and bytes in one visible table, download the TXT report, and use the feedback link below to send any format or measurement issue.
Try Image Size CheckerTry the workflow and tell us what worked, what failed, or what needs clearer guidance: hi@imgrove.com.