Compress PDF - Reduce PDF File Size Free Online

Compress PDF files instantly in your browser — no upload, no sign-up. Reduce PDF size by up to 85% while keeping text crisp. Free and private.

Image quality60%

Lower quality = smaller file. Pages are flattened to images, so text is no longer selectable.

Shrink your PDF without losing what matters

Upload a PDF and cut its file size down — fast, free, and entirely in your browser. No account needed, no waiting for a server, no size limit imposed by a queue.

Large PDFs are a headache: email attachments bounce, upload fields reject them, and sharing a 40 MB scan feels embarrassing. This tool strips out redundant data and resamples embedded images so the file stays readable but takes up far less space.

How to compress a PDF — step by step

  1. Click "Choose file" (or drag your PDF onto the upload area above).
  2. Pick a compression level — light keeps quality high; heavy shrinks the file as much as possible.
  3. Click "Compress PDF" and wait a moment while your browser processes the file.
  4. Download the result. The new file name shows the reduced size so you can compare instantly.

Your PDF never leaves your device. It is processed entirely in your browser using JavaScript — unlike most online PDF tools, nothing is uploaded to a server.

Realistic example: compressing a scanned report

Say you have a 12-page scanned report saved as a PDF. Original size: 8.4 MB. After applying medium compression (image quality reduced to 72 dpi equivalents, duplicate font data removed), the output comes out at roughly 1.9 MB — a 77% reduction — while the text stays crisp and legible on screen and in print.

Compression levelTypical size reductionBest for
Light10–30%Contracts, forms you'll sign again
Medium40–70%Reports, presentations, portfolios
Heavy70–90%Scanned documents, archival files

How to compress a PDF in code

Sometimes you need to reduce PDF size in a script or a build pipeline rather than by hand. Here are two common approaches.

Python — using Ghostscript

Ghostscript is the most reliable open-source tool for PDF file-size reduction. Install it from ghostscript.com, then run:

import subprocess

def compress_pdf(input_path, output_path, quality='ebook'):
    # quality options: screen | ebook | printer | prepress
    subprocess.run([
        'gs',
        '-sDEVICE=pdfwrite',
        '-dCompatibilityLevel=1.4',
        f'-dPDFSETTINGS=/{quality}',
        '-dNOPAUSE',
        '-dBATCH',
        f'-sOutputFile={output_path}',
        input_path
    ], check=True)

compress_pdf('report.pdf', 'report_small.pdf', quality='ebook')

The ebook preset targets roughly 150 dpi — good enough for on-screen reading and email. Use screen for maximum shrinkage or printer when print quality must be preserved.

JavaScript (Node.js) — using pdf-lib

pdf-lib can rewrite and strip metadata from a PDF. For deeper image-level compression you would pair it with sharp or a canvas library, but for quick size reduction on pure-text PDFs this works well:

import { PDFDocument } from 'pdf-lib';
import fs from 'fs/promises';

async function stripMetadata(inputPath, outputPath) {
  const existingBytes = await fs.readFile(inputPath);
  const pdfDoc = await PDFDocument.load(existingBytes);

  // Remove author, title, and other optional metadata
  pdfDoc.setTitle('');
  pdfDoc.setAuthor('');
  pdfDoc.setSubject('');
  pdfDoc.setKeywords([]);
  pdfDoc.setProducer('');
  pdfDoc.setCreator('');

  const pdfBytes = await pdfDoc.save({ useObjectStreams: true });
  await fs.writeFile(outputPath, pdfBytes);
}

stripMetadata('report.pdf', 'report_small.pdf');

The useObjectStreams: true flag tells pdf-lib to pack objects more tightly, which alone can trim 5–15% off many PDFs.

How it works under the hood

PDF files can grow large for a few reasons: high-resolution embedded images, duplicate font data, revision history left by editors like Word or Acrobat, and uncompressed object streams. Compression works by resampling images to a lower resolution, removing those revision snapshots, and re-encoding object streams with Deflate (the same algorithm ZIP uses).

This browser tool uses JavaScript libraries that read the PDF structure, apply those optimisations, and write a new, leaner file — all locally on your machine. The PDF specification (maintained by PDF Association) defines exactly how object streams and image compression work inside a PDF, if you want the full technical detail.

When to use this tool — and when to try something else

Use it when:

  • A PDF is too large to email (most providers cap at 25 MB).
  • You need to upload a document to a portal with a strict file-size limit.
  • A scanned file is bloated because it was saved at 300 dpi when 96 dpi is plenty for screen use.
  • You want to reduce storage costs on cloud drives without converting to a different format.

Consider a different approach when:

  • The PDF contains vector artwork or fine-print legal text where any image resampling is unacceptable — use printer or prepress settings in Ghostscript instead.
  • You need to make heavy edits before compressing — edit first, then compress, so you don't lose quality twice.
  • The file is already very small (under 100 KB) and most of its weight is actual text content — there is little left to remove.
  • You need to reduce multiple PDFs at once on a schedule — a command-line script (see the Python example above) will be faster than uploading one at a time.

Once your file is the right size, you might also need to merge several PDFs into one or split out specific pages — both of which you can do with the same tool engine here on TechToolExpert.

If you work with structured data formats too, our JSON Beautifier and JSON Minifier - Compress & Minify JSON Online follow the same browser-only, no-upload approach for JSON files.

Bottom line: if your PDF is too big to send or upload, drop it above and download a smaller version in seconds — no sign-up, no upload, no waiting.

Frequently asked questions

Is my PDF uploaded to a server when I compress it here?+
No. The entire compression process runs inside your browser using JavaScript. Your file never leaves your device and is never sent to any server. This is different from most online PDF compressors, which upload your file to process it on their end.
How much can I reduce a PDF file size?+
It depends on what's inside the PDF. Scanned documents and image-heavy files often shrink by 60–85%. PDFs that are mostly text with embedded fonts typically reduce by 10–30%. If the file is already well-optimised, gains will be smaller.
Will compression reduce the quality of my PDF?+
Light compression is nearly invisible to the eye. Heavy compression resamples images to a lower resolution, which can make photos look slightly softer. Text rendered as actual PDF text (not a scanned image) is never degraded — only pixel images inside the PDF are affected.
Is this tool free? Do I need to create an account?+
Completely free, no account required. Open the page, upload your PDF, download the result. There is no sign-up, no watermark, and no trial limit.
What is the maximum PDF file size I can compress?+
Because processing happens in your browser, the practical limit is tied to your device's available memory rather than a server quota. Most modern laptops handle PDFs up to 100–200 MB without trouble. Very large files (500 MB+) may be slow or may cause the browser tab to run out of memory — for those, the Ghostscript command-line approach shown above is more reliable.
What's the difference between 'compress PDF' and 'optimize PDF'?+
'Compress PDF' and 'optimize PDF' mean the same thing in everyday use — both refer to reducing file size by resampling images, removing redundant data, and tightening the internal file structure. Some tools use 'optimise' to imply a lighter, quality-preserving pass, while 'compress' can imply more aggressive shrinkage, but there is no universal standard for the terminology.
How do I compress a PDF in Python?+
The most reliable way is to call Ghostscript from Python using the subprocess module. Set -dPDFSETTINGS=/ebook for a good balance of size and quality. A full runnable example is in the 'How to compress a PDF in code' section above.
Can I compress a password-protected PDF?+
Only if you know the password. Most compression tools — including this one — need to read and rewrite the PDF's internal structure, which is blocked by encryption. Remove the password protection first (you'll need the password to do so), then compress.