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.
| Photos | Under 40KB | File size | Width | Pixels kept | JPG quality | SSIM | Time |
|---|---|---|---|---|---|---|---|
| iPhone photos, 12–48 MP | 20 of 20 | 39.7 KB | 594 px | 2% | 59 | 0.750 (lowest 0.519) | 2.3 s |
| Web-size photos, 768 × 512 | 24 of 24 | 39.7 KB | 650 px | 91% | 61 | 0.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.
| Photo | Original | Result | Size | Quality | SSIM |
|---|---|---|---|---|---|
| Barcelos, Vila Boa e Vila Frescainha (São Martinho e São Pedro) - Igreja de Nossa Senhora do Terço 01 | 3024 × 4032, 5.5 MB | 382 × 510 | 39.3 KB | 62 | 0.519 |
| Bloki na ulicy Goszczynskiego Sosnowiec Środula 02 | 4032 × 3024, 9.7 MB | 571 × 428 | 39.7 KB | 65 | 0.723 |
| Boston Basilica interior 02 | 5425 × 4063, 4.0 MB | 573 × 429 | 39.8 KB | 54 | 0.722 |
| -i---i- (54245759081) | 3024 × 4032, 3.8 MB | 665 × 887 | 39.8 KB | 61 | 0.950 |
| Carinda Roman Catholic Church 09-08-2024 | 3530 × 2667, 1.5 MB | 676 × 510 | 39.8 KB | 56 | 0.797 |
| China Merchants Bank Building in Shanghai at night 02 | 3024 × 4032, 2.7 MB | 568 × 757 | 40 KB | 53 | 0.896 |
| 8787 Georgia Avenue 09 | 5074 × 3781, 4.0 MB | 636 × 474 | 39.9 KB | 58 | 0.747 |
| -i---i- (51970200648) | 4032 × 3024, 5.6 MB | 786 × 590 | 39.9 KB | 61 | 0.950 |
| 20230807 145136 August 2023 in Białystok | 3024 × 4032, 1.5 MB | 568 × 757 | 39.7 KB | 59 | 0.824 |
| 'One Old Road' (1 Old Road) with windows and a high brick wall, viewed from Old Road in Chatham, Kent | 4588 × 3347, 13.6 MB | 584 × 426 | 39.4 KB | 55 | 0.690 |
| Moscow 2025-11-20 05 | 8064 × 6048, 26.0 MB | 625 × 468 | 39.5 KB | 59 | 0.774 |
| Parks Mall at Arlington Atrium (2024) | 5712 × 4284, 13.6 MB | 604 × 454 | 39.6 KB | 54 | 0.753 |
| BorNE.DOMB-LEPA.v-02 | 2268 × 4032, 4.8 MB | 347 × 617 | 39.5 KB | 55 | 0.692 |
| 20230806 191612 August 2023 in Białystok | 4032 × 3024, 1.4 MB | 790 × 592 | 39.9 KB | 59 | 0.896 |
| Caltabellotta - Chiesa di San Pellegrino - 2025-08-29 ruins | 4032 × 3024, 4.4 MB | 632 × 474 | 39.7 KB | 57 | 0.733 |
| Operação Lais de Guia GLO 2023 (53316687826) | 4032 × 3024, 1.7 MB | 736 × 552 | 39.4 KB | 51 | 0.887 |
| Aulangon näkötorni heinäkuussa 2023 | 2268 × 4032, 2.8 MB | 388 × 689 | 39.7 KB | 63 | 0.647 |
| Buca metrosu temel atma töreni 02 | 4032 × 3024, 2.0 MB | 734 × 550 | 39.9 KB | 54 | 0.888 |
| 39 Harleyford Road | 3024 × 4032, 4.7 MB | 398 × 531 | 39.6 KB | 61 | 0.547 |
| Atlas apartment high-rise (Vuotie 47 B, Vuosaari, Helsinki, Finland) Mar 28, 2026 | 3731 × 6636, 4.3 MB | 350 × 622 | 39.6 KB | 67 | 0.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.
| Format | Under 40KB | Width | Pixels kept | SSIM | File size | Encode time |
|---|---|---|---|---|---|---|
| JPG | 6 of 6 | 478 px | 3% | 0.758 | 39.7 KB | 1.1 s |
| WebP | 6 of 6 | 526 px | 4% | 0.789 | 39.9 KB | 10.6 s |
| AVIF | 6 of 6 | 514 px | 4% | 0.810 | 39.3 KB | 51.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).