Small SEO Tools

How to Check an Image Against an Exact Byte Limit

An image can appear to be under a 200 KB limit and still exceed a form’s exact byte allowance. Rounded displays and different meanings of the unit can hide the difference. For a strict upload rule, compare the saved file’s actual byte count with the documented cap.

This walkthrough uses the Image Compressor while keeping an 800 by 600 pixel image at the same dimensions. The example rule is at most 200,000 bytes. It is a chosen test requirement, not the policy of a particular upload service.

Translate the upload rule into bytes first

Check the receiving form’s instructions for its maximum file size, accepted formats and required dimensions. If it gives only a number followed by KB, look for the documented byte value before treating a rounded result as a pass.

Decimal and binary units differ. NIST explains binary prefixes and their distinction from SI prefixes: 200 kilobytes at 1,000 bytes each is 200,000 bytes, while 200 kibibytes at 1,024 bytes each is 204,800 bytes. An upload service may use its label loosely, so its actual rule matters.

The current compressor divides byte counts by 1,024 for its KB display and rounds to one decimal place. That display is useful for comparing candidates, but it does not establish whether a file meets a different exact cap.

Make a candidate without changing required dimensions

  1. Keep the original and load it in the compressor. The displayed 20 MB input limit belongs to this tool; it is separate from the destination upload limit.
  2. Select an output format that the destination accepts. For this example, choose JPEG.
  3. Leave Maximum width blank to preserve the loaded width and height. If the form requires 800 by 600, check those dimensions in the before and after captions.
  4. Choose a quality setting, let the result update and inspect the after preview. You can also press Compress now.
  5. Select Download compressed and check that saved candidate’s exact byte count.

The slider controls encoding quality, not a requested file size. The tool has no target-byte field. MDN’s canvas export documentation describes the quality argument for lossy formats such as JPEG and WebP; it is not an output-byte guarantee.

See why a displayed 197.1 KB can fail

We ran the current compressor code locally in Chrome with a deterministic 800 by 600 PNG filled with synthetic pixel noise. These are unmodified JPEG encoding results, not files padded to reach a boundary. An independent decoder confirmed both outputs remained 800 by 600.

JPEG quality Tool display Exact file bytes At most 200,000 bytes?
56 197.1 KB 201,864 No
50 180.6 KB 184,943 Yes

The first display looks lower than 200, but the file exceeds this example cap by 1,864 bytes. The second meets the byte requirement without changing dimensions. These settings demonstrate the measurement problem; they are not quality recommendations or size predictions for a photograph.

Verify the saved file and submit that version

Open the downloaded file’s properties or information panel and read its size in bytes. Use the file’s logical size, not a separate size-on-disk value or a rounded folder listing. In browser file APIs, the size property likewise reports bytes.

If your candidate exceeds the cap, return to the loaded original, try a lower JPEG quality and check the new download. Inspect important lettering, faces and edges after each change. Do not shrink required dimensions just to make the byte count pass. If another format is allowed, compare it separately and measure its actual result.

Select the checked candidate in the receiving form, confirm its filename and inspect the final preview. Meeting the byte cap is one requirement; the file still needs the right format, dimensions and usable detail. Our website image compression guide covers that broader visual comparison.