DEV Community

Himanshu Sharma
Himanshu Sharma

Posted on

Compressing PDFs to 200KB using a simple client-side approach

PDF size limits are still annoying.

I’ve run into this problem many times while filling online forms or uploading
documents. A lot of websites still ask for PDFs under very specific limits,
like 200KB or 1MB, which sounds small until you actually try uploading a file.

While working on a small React project, I decided to experiment with a
client-side PDF compression tool to see how much can realistically be done
inside the browser.

What this tool is about

This is not meant to be a replacement for full-featured PDF editors.
It’s more of a lightweight solution for common cases.

The tool focuses on:

  • Running fully in the browser
  • No server uploads
  • Simple file selection
  • Handling strict size limits like 200KB

Why I tried client-side compression

The main reason was privacy.

For many documents, uploading files to a server just to resize them feels
unnecessary. Doing everything locally keeps things simple and avoids storing
files anywhere.

It’s also surprisingly fast for smaller PDFs.

Live version

I’ve put a working version online so it’s easier to understand how it behaves
in real use:

Compress Now !

When this works well

From my testing, this approach works best for:

  • Form submissions with strict limits
  • Quick document uploads
  • Mobile users
  • Situations where privacy matters more than perfect quality

Final notes

Browser-based tools are getting better every year.
For basic use cases, client-side PDF handling is actually quite practical.

If you’re building React apps or experimenting with browser APIs, this kind of
tool is worth exploring.

Top comments (0)