Compress Image to 40KB

Compress an image to 40 KB as a JPG. Our 20 phone photos all fit at a median 594 px wide. Good inside 20–50 KB photo ranges, too small for a China visa.

How to use Compress Image to 40KB

  1. 1Upload a JPG, PNG, or WebP image.
  2. 2Pixohub automatically searches for the highest quality that fits under 40KB.
  3. 3Check the resulting file size shown on the page.
  4. 4Download your image, now 40KB or smaller.

Features

  • Automatically targets 40KB — no manual guessing
  • Keeps quality as high as the size budget allows
  • Runs entirely in your browser; nothing is uploaded
  • Free, unlimited, no signup or watermark

Compressing an image to 40KB: what to expect

At 40 KB the median phone photo in our test came out 594 pixels wide and kept 2.4% of its pixels, with an SSIM of 0.75. This is the first size in our range where the typical result reaches three-quarters similarity to the original at phone-screen width.

Few official forms use 40 KB as a maximum. People pick it as a safe target inside a range such as the 20–50 KB photograph rule for IBPS and SBI, well above the minimum and below the cap. Reading which end of a range the number belongs to is the decision that matters: 40 KB is also the minimum for the China visa photo, and this page's output falls just under it.

Our test: 44 real photos compressed to 40KB

Every phone photo fitted, from 39.3 to 40.0 KB, with a median width of 594 px, median quality 58.5 and SSIM 0.75. The gap between best and worst stays wide, 0.519 for the Barcelos church against 0.950 for the best, so 40 KB is a fine budget for a simple shot and a tight one for a cluttered street.

The 48 MP Moscow photo (8064 × 6048, 26 MB) came out 625 × 468, about the same as the 12 MP photos, because the file budget depends on what the scene contains, not on how many megapixels the camera had. Web-size 768 × 512 photos kept 90.5% of their pixels at SSIM 0.911.

Method: each photo went through this page in Chromium on an Apple M2 Mac. 40KB means 40,000 bytes, so the result passes whether a site counts a KB as 1,000 or 1,024 bytes. Figures are medians. SSIM compares the result with the original at 1080 px wide, about what a phone screen shows (1.000 = identical). How we test.

PhotosUnder 40KBFile sizeWidthPixels keptJPG qualitySSIMTime
iPhone photos, 12–48 MP20 of 2039.7 KB594 px2%590.750 (lowest 0.519)2.3 s
Web-size photos, 768 × 51224 of 2439.7 KB650 px91%610.911 (lowest 0.766)0.9 s

Last updated

Every phone photo at 40KB

All 20 photos from our test set, so you can find one like yours. Quality is the JPG quality the tool settled on; when it would have dropped below 50, the photo was scaled down instead.

PhotoOriginalResultSizeQualitySSIM
Barcelos, Vila Boa e Vila Frescainha (São Martinho e São Pedro) - Igreja de Nossa Senhora do Terço 013024 × 4032, 5.5 MB382 × 51039.3 KB620.519
Bloki na ulicy Goszczynskiego Sosnowiec Środula 024032 × 3024, 9.7 MB571 × 42839.7 KB650.723
Boston Basilica interior 025425 × 4063, 4.0 MB573 × 42939.8 KB540.722
-i---i- (54245759081)3024 × 4032, 3.8 MB665 × 88739.8 KB610.950
Carinda Roman Catholic Church 09-08-20243530 × 2667, 1.5 MB676 × 51039.8 KB560.797
China Merchants Bank Building in Shanghai at night 023024 × 4032, 2.7 MB568 × 75740 KB530.896
8787 Georgia Avenue 095074 × 3781, 4.0 MB636 × 47439.9 KB580.747
-i---i- (51970200648)4032 × 3024, 5.6 MB786 × 59039.9 KB610.950
20230807 145136 August 2023 in Białystok3024 × 4032, 1.5 MB568 × 75739.7 KB590.824
'One Old Road' (1 Old Road) with windows and a high brick wall, viewed from Old Road in Chatham, Kent4588 × 3347, 13.6 MB584 × 42639.4 KB550.690
Moscow 2025-11-20 058064 × 6048, 26.0 MB625 × 46839.5 KB590.774
Parks Mall at Arlington Atrium (2024)5712 × 4284, 13.6 MB604 × 45439.6 KB540.753
BorNE.DOMB-LEPA.v-022268 × 4032, 4.8 MB347 × 61739.5 KB550.692
20230806 191612 August 2023 in Białystok4032 × 3024, 1.4 MB790 × 59239.9 KB590.896
Caltabellotta - Chiesa di San Pellegrino - 2025-08-29 ruins4032 × 3024, 4.4 MB632 × 47439.7 KB570.733
Operação Lais de Guia GLO 2023 (53316687826)4032 × 3024, 1.7 MB736 × 55239.4 KB510.887
Aulangon näkötorni heinäkuussa 20232268 × 4032, 2.8 MB388 × 68939.7 KB630.647
Buca metrosu temel atma töreni 024032 × 3024, 2.0 MB734 × 55039.9 KB540.888
39 Harleyford Road3024 × 4032, 4.7 MB398 × 53139.6 KB610.547
Atlas apartment high-rise (Vuotie 47 B, Vuosaari, Helsinki, Finland) Mar 28, 20263731 × 6636, 4.3 MB350 × 62239.6 KB670.706

Last updated

JPG vs WebP vs AVIF at 40KB

AVIF pulled ahead at 40 KB in our six-photo run: SSIM 0.81 against 0.789 for WebP and 0.758 for JPG, although WebP kept slightly more width (525.5 px vs 513.5 px for AVIF and 478 px for JPG). The cost was about 51 s per photo for AVIF and 10.6 s for WebP; JPG took 1.1 s. For a form upload, the JPG result is the one to use.

Same method, on 6 of the phone photos: the highest quality that fits, scaling down only when quality would drop below 50. WebP and AVIF were encoded with libwebp and libavif in the browser.

FormatUnder 40KBWidthPixels keptSSIMFile sizeEncode time
JPG6 of 6478 px3%0.75839.7 KB1.1 s
WebP6 of 6526 px4%0.78939.9 KB10.6 s
AVIF6 of 6514 px4%0.81039.3 KB51.0 s

Last updated

Where you'll meet a 40KB limit

The only verified limit at exactly 40 KB is a minimum: China's online visa form wants a photo between 40 KB and 120 KB. This page aims just under 40,000 bytes, so it would fail that check; use the 100 KB or 120 KB page for the China visa.

Where 40 KB earns its place is under a 50 KB cap, such as the IBPS and SBI photograph (20–50 KB) or the IBPS thumb impression, or under the 60 KB signature limits of Bangladesh's BPSC exam and Singapore's ABTC card.

  • Chinese Visa Application Service Center (visaforchina.cn, authorised by Chinese embassies/consulates): Photo uploaded in the China online visa application form (minimum; this page's result lands just under it, so choose a larger target and stay within their maximum). “can only be accepted as JPEG format ... dimensions of which cannot exceed 354*472 ... with a file size between 40KB-120KB” Visa for China FAQ: How to upload the photo when filling in the online application form?

Tips for getting a good image at 40KB

  • For IBPS or SBI photos, resize to the preferred 200 × 230 px first, then check that the result isn't below 20 KB: an image that small may come in lighter even at top quality, and this page won't pad it.
  • Check which end of a range 40 KB sits on before using this page; as a minimum (China visa) it is the wrong target.
  • Start from the original photo, not a screenshot or a copy already shrunk by a messaging app. Re-compressing a JPG stacks the artifacts of both passes.
  • If 40 KB still looks soft and the cap is 50 KB, go straight to the 50 KB page (median width 668.5 px).

Frequently asked questions

My form wants a photo between 20 KB and 50 KB. Is 40 KB a good choice?

Yes. A file from this page lands at 39.3–40.0 KB in our test, well inside 20–50 KB however the site counts a KB. If the form also gives pixel dimensions, such as 200 × 230 px, resize to those first and confirm the final file is still above 20 KB.

Can I use this page for the China visa photo?

No. China's online visa form requires 40–120 KB, and this page targets just under 40,000 bytes, below the minimum. The form also caps dimensions at 354 × 472 px. Resize to fit those dimensions, then use the 100 KB or 120 KB page and check the result is above 40 KB.

Why does my 48 MP photo come out no bigger than a 12 MP one?

The file budget, not the camera, decides the output size. In our test the 48 MP Moscow photo came out 625 × 468 px at 40 KB, similar to the 12 MP photos. Extra megapixels mostly add fine detail that the encoder can't afford at this size, so they are scaled away.

Will 40 KB look noticeably better than 30 KB?

A bit. Median width grows from 511 px to 594 px and SSIM from 0.71 to 0.75. On a form that shows the photo at passport size the difference is hard to spot, but if the rule allows 40 KB there is nothing to gain from going lower.

More ways to compress

Batch: compress many images at once

Same processing as above, run across a set of files. Pro returns the whole batch as one ZIP. Still entirely in your browser.

Free · up to 20

PRONeed more than 20 at a time?

Pro runs up to 150 images per batch as one ZIP, keeps your brand mark on every export, and lifts the file ceiling to 200 MB.

Unlock with Pro