Resize a PDF or Image to a Target File Size

KB
Enter the maximum file size you want.

How the File Resizer Works

For JPG / PNG / WebP Images

The tool draws your image onto an HTML canvas, then uses a binary-search compression algorithm to find the JPEG quality setting that produces the closest file size to your target. It adjusts quality up and down in up to 20 iterations until it lands within 5% of your target KB.

Note: PNG and WebP files are re-encoded as JPEG during compression since JPEG offers the best size-to-quality ratio.

For PDF Files

Each page of the PDF is rendered to a canvas at progressively lower resolution and re-encoded as JPEG. The pages are then reassembled into a new PDF using pdf-lib. The tool tries multiple scale and quality combinations to get within 10% of your target size.

Note: PDFs with many pages or complex graphics may take longer to process. The tool works best for scanned PDFs and image-based PDFs.

How to Resize a PDF or Image to a Specific KB

  1. Click Select file and choose a PDF, JPG, PNG or WebP file.
  2. Enter your target size in KB — for example, 200 KB for a form upload limit, or 100 KB for an email attachment.
  3. Click Resize & Download. The tool compresses the file automatically.
  4. A prompt will ask for your preferred filename. Enter a name and confirm.
  5. The resized file downloads to your device immediately.

Best for: Compressing documents for online form uploads with strict size limits, reducing PDF size for email attachments, resizing student photos for exam registration portals, compressing scanned PDFs and government documents.

Supported File Types & Limits

FormatSupportedOutput format
PDF (.pdf)✅ YesPDF
JPG / JPEG✅ YesJPG
PNG✅ YesJPG (smaller)
WebP✅ YesJPG (smaller)
Privacy: Your files are processed entirely in your browser. Nothing is uploaded to any server — your documents stay on your device.

Frequently Asked Questions

How accurate is the target file size?

The tool gets within 5% of your target for images and within 10% for PDFs. The exact result depends on the content — heavily textured images are harder to compress to precise sizes than simple scanned documents.

What if my file is already smaller than the target?

If your file is already at or below the target KB, the original file is returned as-is without any quality loss.

Can I resize scanned government documents?

Yes. Scanned PDFs (image-based PDFs) work well with this tool. Each page is re-rendered at lower resolution and quality until the combined PDF reaches your target size.

Will resizing reduce image quality?

Yes — compression always involves some quality reduction. The tool finds the highest quality setting that still fits within your target size, so quality loss is minimised. For very small targets (below 50 KB), some visible quality reduction is expected.

Is there a file size limit for uploads?

There is no hard limit since everything runs in your browser. However, very large files (above 50 MB) may be slow to process depending on your device's memory and CPU speed.

Back to All PDF Tools