Tools
🏠 All Tools 📖 All Guides 🗜️ Compress to 20KB 🗜️ Compress to 50KB 🗜️ Compress to 100KB 📐 Resize by Pixels 🔁 Convert to JPG ✏️ Add Text
Other
🌍 Passport Photos
📅 Updated April 2026 ⏱️ 8 min read 🗜️ Compression Guide

How to Compress Image to 20KB Without Losing Quality: A Complete Guide

If you've ever tried uploading a photo to a government job portal and got the error "file size must be under 20KB" — you're not alone. This specific file size limit shows up everywhere, from NADRA Pakistan passport applications to Indian railway exam portals, and most people have absolutely no idea how to hit it without completely destroying their image quality.

In this guide, we'll walk you through exactly how image compression works, which formats make it easier, and how different types of users — from government job applicants to web developers — can get their images under 20KB quickly and without the headache.

📋 Table of Contents
  1. Who actually needs a 20KB image?
  2. Why do portals set a 20KB limit?
  3. Format comparison: JPG vs PNG vs WebP
  4. Lossy vs Lossless compression explained
  5. Step-by-step: How to compress to 20KB
  6. Use-case guides: Government, exams, web
  7. Understanding dimensions and DPI
  8. Frequently asked questions

Who Actually Needs a 20KB Image?

The 20KB limit isn't random. It appears in very specific situations and understanding who needs it helps you understand why the limit exists at all. There are basically two kinds of users searching for this:

Government Job and Exam Applicants

This is by far the biggest group. If you're applying for a government job in India, Pakistan, Bangladesh or several other countries, the online application portal almost certainly has a strict file size requirement for your photo and your signature scan. These portals were often built years ago when bandwidth was expensive, and the 20KB limit stuck around even as internet speeds improved.

Common portals with 20KB limits include NADRA Pakistan for CNIC and passport applications, SSC and railway exam portals in India, various state government job boards, and visa application portals for certain countries. Missing this requirement doesn't just cause an error — it can get your entire application rejected without any explanation.

If you're applying for a passport, you might also want to check out our India passport photo guide which covers the 300KB limit for Passport Seva, or the Pakistan passport photo guide which goes into detail about NADRA's specific requirements.

Web Developers and Performance Engineers

The second group is web developers who are trying to optimise their Core Web Vitals scores, particularly the Largest Contentful Paint (LCP) metric. Small icons, avatars, thumbnails and signature images on a website should ideally be under 20KB to avoid slowing down page loads.

For developers, the approach is slightly different — you have more flexibility with formats like WebP, and you're less concerned about specific pixel dimensions and more focused on visual sharpness at small sizes.

Why Do Portals Set a 20KB Limit?

Government portals have 20KB limits for a few practical reasons. First, they were designed when average internet connections in the country were much slower. A smaller file uploads reliably even on a 2G or 3G connection without timing out. Second, when you're storing millions of application records with photos and signatures, keeping each image small adds up to massive savings in database storage. Third, smaller files process faster through automated systems that check image validity.

💡 Good to know: The 20KB limit usually applies to your photo and your signature separately. Your passport-sized photo needs to be under 20KB AND your signature scan also needs to be under 20KB. Both are different images with slightly different dimension requirements.

Format Comparison: JPG vs PNG vs WebP

One of the most important factors in reaching 20KB is choosing the right image format. Not all formats compress equally, and understanding the differences can save you a lot of frustration.

Format Best For Compression Ability Reaching 20KB Accepted by Portals?
JPEG Photos, portraits, passport photos High — adjustable quality ✅ Easy ✅ Universal
PNG Logos, text, graphics with transparency Low — lossless only ⚠️ Difficult ✅ Usually accepted
WebP Web images, modern browsers Superior — 25-30% smaller than JPEG ✅ Easier than JPEG ⚠️ Not all portals
BMP Uncompressed raw images None — no compression ❌ Impossible for most images ❌ Rarely

For government portals, JPEG is almost always the right choice. It's universally accepted, compresses well, and handles portrait photos without visible loss at small sizes. If you have a PNG file, the first thing you should do is convert it to JPG before compressing. This alone can cut your file size dramatically before any quality reduction is applied.

WebP is excellent for web developers who are targeting LCP improvements. If you're working on website performance, consider converting your images to WebP using our convert to WebP tool — it can achieve the same visual quality as JPEG at 25-30% smaller file sizes, making 20KB targets much easier to hit.

Lossy vs Lossless Compression Explained

This is the part that confuses most people, so let me keep it simple.

Lossless Compression

Lossless compression reduces file size without removing any image data. When you decompress a losslessly compressed image, you get back exactly the original. PNG uses lossless compression. The problem is there's a limit to how much you can reduce file size this way — and for photos, that limit is usually nowhere near 20KB.

Lossy Compression

Lossy compression achieves smaller file sizes by permanently removing some image data — specifically data that the human eye is least likely to notice. JPEG uses lossy compression. At moderate levels, the quality loss is invisible. At aggressive levels, you start to see blurring and artefacts, particularly around sharp edges and text.

⚠️ Important: Reaching 20KB almost always requires lossy compression. Some quality reduction is inevitable. However, for small images like 200x200 passport photos or 140x60 signature scans, modern JPEG compression can reach 20KB with quality that looks completely acceptable on screen and in print.

Think of it like this — if you have a 4000x3000 pixel photo from your smartphone, compressing it to 20KB will cause noticeable quality loss because you're removing enormous amounts of data. But if you start with the correctly sized image — say 600x600 pixels for an Indian passport photo — reaching 20KB is achievable with minimal visible difference.

Step-by-Step: How to Compress to 20KB

Here is the exact process to get any image under 20KB using our free tool:

  1. Open the compress to 20KB tool Go to photo.fiximg.ai/compress-image-to-20kb/ on any device — mobile or desktop.
  2. Upload your image Click the upload area or drag and drop your file. Supports JPG, PNG and WebP up to 20MB. If your file is a PNG, consider converting it to JPG first for better results.
  3. Automatic compression runs The tool automatically finds the right quality level to bring your image to just under 20KB. No slider, no guessing — it hits the target precisely.
  4. Check the preview Compare the original and compressed images side by side. The tool shows the resulting file size so you know exactly what you're downloading.
  5. Download your compressed image Click Download and save the file. Its ready for upload to any portal with a 20KB limit.

🗜️ Compress Your Image to 20KB Now — Free

No signup, no watermark. Upload and download in seconds.

Open 20KB Compressor →

Use-Case Specific Guides

For Government Job Applications and Exams (India, Pakistan, Bangladesh)

Most government exam portals in South Asia require two images — your passport-sized photo and your signature. Both usually need to be under 20KB. Here's the typical requirements:

DocumentTypical DimensionsFormatSize Limit
Passport Photo200x200 px or 35x45mmJPEG20KB
Signature Scan140x60 pxJPEG20KB
Thumbprint100x100 pxJPEG20KB

The key insight here is that you should resize your image to the correct dimensions first, then compress. If you resize a passport photo to 200x200 pixels and then compress to 20KB, the quality will be much better than if you try to compress a 1000x1000 pixel photo to 20KB. Use our resize by pixels tool to get dimensions right first.

For NADRA Pakistan specifically, both the photo and signature must be under 20KB. This is one of the strictest file size requirements among all government portals worldwide. The signature image dimension is typically 140x60 pixels at 96 DPI.

For Web Developers: Improving Core Web Vitals

If you're a developer trying to improve your LCP score, 20KB images are a common target for small UI elements. Icons, avatars, badges and decorative images should ideally be this size or smaller. A few principles to keep in mind:

Understanding Dimensions and DPI

Two concepts that trip a lot of people up are image dimensions (measured in pixels) and DPI (Dots Per Inch). They're related but different.

Pixels and File Size

Image file size is directly related to the number of pixels. A 600x600 pixel image has 360,000 pixels. A 200x200 pixel image has 40,000 pixels — which is nine times fewer. Fewer pixels means the compressor has less data to work with, making it much easier to hit a small target like 20KB without quality loss.

DPI Explained

DPI refers to how many dots (pixels) are packed into one inch when printed. 72 DPI is standard for screens. 300 DPI is standard for printing. But here's the thing — DPI doesn't affect digital file size directly. A 200x200 pixel image at 300 DPI is the exact same file size as a 200x200 pixel image at 72 DPI. DPI only matters when you print. For online portal submissions, you can ignore DPI and focus entirely on pixel dimensions.

If you need to resize your image in physical measurements for printing — say a 35x45mm passport photo at 300 DPI — use our resize in millimeters tool which handles the DPI conversion automatically.

💡 Quick calculation: At 300 DPI, 1 cm = 118 pixels. So a 35x45mm image at 300 DPI = 413x531 pixels. At that dimension, a JPEG can reach 20KB quite easily with quality that's still acceptable for official use.

Common Mistakes to Avoid

Frequently Asked Questions

Yes, but PNG files are harder to compress to 20KB because they use lossless compression. The easiest way is to convert your PNG to JPG first, then compress to 20KB. JPG files can reach 20KB much more easily without visible quality loss. Our convert image to JPG tool handles this in one click.
Not necessarily. If your original image has small dimensions like 200x200 pixels or 140x60 pixels for signatures, it can reach 20KB with virtually no visible quality loss. Larger images like 1920x1080 will show some quality reduction but remain usable for most official purposes. The trick is to resize to the required dimensions before compressing.
JPEG is the best format for reaching 20KB for photos and portraits. WebP is technically superior and can be 25-30% smaller than JPEG at the same quality, but not all government portals accept WebP. For official submissions, stick with JPEG unless the portal specifically accepts WebP.
NADRA Pakistan set a 20KB limit for their online portal to ensure fast uploads on slower internet connections and to keep their database storage efficient. This limit applies to both the passport photo and the signature scan uploaded during CNIC and passport applications.
Use our compress to 20KB tool. It automatically finds the exact compression level to bring your file to just under 20KB. If quality reduction alone is not enough, it also scales the image dimensions proportionally until the target size is reached.
Yes. Our compression tool works on any device including Android and iPhone. Just open the link in your mobile browser, upload your photo and download the compressed file directly to your phone.

Related Guides