Compress PDF Files
Compress PDF makes a PDF smaller by recompressing its internal data and re-encoding page images as JPEG at a capped size. Add an optional target size in MB and it tries stronger levels until the file fits; the target is a goal, not a guarantee.
Drag and drop files here, or click to choose
Accepts PDF · up to 500.0 MB per file · up to 20 files at once
You can also paste a file with Ctrl/Cmd+V, or from the clipboard menu.
Compress shrinks a PDF in two steps. First qpdf recompresses streams and packs objects into object streams. Then page images are re-encoded as JPEG and capped in size. It is for email caps, LMS uploads, and portals that reject a file for being too heavy.
The qpdf flags are `--compress-streams=y`, `--recompress-flate`, and `--object-streams=generate`. The image step handles JPEG images and 8-bit DeviceRGB or DeviceGray Flate images. The default level uses JPEG quality 75 and caps the longest side at 2000 px. A re-encoded image replaces the original only when it is smaller.
The optional `targetSizeMb` field (0.05 to 1024, labelled "Target size in MB (optional)") turns this into a goal: the tool tries seven levels from gentle to strong, from JPEG quality 75 down to 18 and longest side 2000 down to 450 px, and stops at the first result that fits. Enter 1 to aim for a PDF under 1 MB. Without it, only the default level runs.
The target is a goal, not a guarantee. If even the strongest level does not fit, you get the smallest result it reached. That happens with text- or vector-heavy files that have little image content, or when the images are of a skipped type. A file that already fits comes back with only the qpdf step applied.
Left as they are: 1-bit and other non-8-bit images (typical fax-style scans), CMYK, indexed images, image masks, soft masks and alpha, masked images, and JPEGs with unusual color spaces. Text, fonts, vector art, links, page count and page size are never changed.
Image re-encoding is lossy, and the loss is visible at the strong levels. Keep an uncompressed master when the file is an archival original or a print proof, and open a few pages of the result before sending it.
Linearize PDF is a separate tool (`/api/v1/misc/linearize-pdf`) for fast web view; it is not this job. If you need the words from a scan, that is OCR to Markdown, not Compress. If you need to strip JavaScript or attachments, that is Sanitize.
Password-protected files are unlocked for you on this page once you enter the password; API callers run Unlock first, because an encrypted file only gets the qpdf step. Broken xref tables may need Repair first.
Compress does not embed or subset fonts and does not convert color spaces. A scan stored as 1-bit images or CMYK barely shrinks, and a 1 MB goal on a 200-page photo book may not be reachable. In that case Split by Page Count sends the file in parts.
The result is a valid PDF with the same page count, page size, and text. Signatures and form structures behave as before unless they were already broken.
Uploads are temporary. We do not keep a compressed archive of your documents.
Features
- qpdf stream recompression and object-stream packing
- Re-encodes JPEG and 8-bit RGB/Gray images; default JPEG quality 75, longest side 2000 px
- Optional targetSizeMb (0.05-1024): seven levels, stops at the first that fits
- Keeps page count, sizes, text, fonts, and vector art unchanged
- Anonymous API at /api/v1/misc/compress-pdf
When to use this tool
- Fit a PDF under an email or portal upload cap, such as 1 MB
- Ship a lighter copy while keeping an uncompressed master
- Shrink a photo-heavy export before attaching it
- Reduce attachment weight when a mail server rejects the original
How do I compress a PDF to a smaller size?
- Upload the PDF that misses a size cap or feels heavy to send.
- Optionally type a target size in MB, such as 1. Leave it empty for the default level.
- Click Process and download the result.
- Compare byte size to the original and open a sample of pages; strong levels lower image quality.
Limits and edge cases
- The target size is a goal, not a guarantee; the smallest result reached is returned
- Image re-encoding is lossy and visible at strong levels
- 1-bit scans, CMYK, indexed, masked and transparent images are skipped
- Password-protected files need the password; API callers run Unlock first
- Broken PDFs may need Repair before compress succeeds
- Does not subset fonts or convert color spaces
- Upload limit on this website: 500 MB per file, sent in chunks above about 95 MB. A single direct API request body is capped at 100 MB.
Examples
- A photo-heavy export with 4000 px JPEGs drops sharply at the default level
- A 7.2 MB two-page photo poster with target size 1 came out at 773 KB; a 32-page, 11.4 MB photo album came out at 1003 KB (measured on freely licensed files)
- A 30 MB pack of 1-bit scans is essentially unchanged because those images are skipped
- A 2 MB text report may only lose a few kilobytes
Privacy for this tool
Files are uploaded over HTTPS, processed in memory or a short-lived temporary directory on our servers, and deleted when your result is ready. We do not keep copies for later browsing, training, or advertising profiles. See the Privacy Policy for retention details and AdSense cookie disclosures.
Frequently asked questions
- Why did my file barely shrink?
- Either it has little image content, so only the qpdf step helps, or its images are of a type that is skipped: 1-bit scans, CMYK, indexed, masked or transparent images.
- Does Compress downsample photos?
- Yes, for JPEG and 8-bit RGB or Gray images. The default level caps the longest side at 2000 px and re-encodes at JPEG quality 75; stronger levels go down to 450 px and quality 18.
- Can I compress a PDF to a specific size, such as 1 MB?
- Enter it as the target size in MB. The tool tries stronger levels until the file fits, and returns the smallest result it reached if none does. A text-heavy file or a large photo book may not reach the target. Split by Page Count sends a file in parts if a portal enforces a hard limit.
- What happens if the target is already met?
- A file that already fits comes back with only the qpdf optimization applied, with content unchanged.
- Is this the same as Linearize PDF?
- No. Linearize PDF is its own tool for page-at-a-time web serving. Compress does not linearize.
- Will text stay selectable?
- Yes. Text and fonts are never changed. Image-only scans remain images.
- Does Compress change how the document looks?
- Page layout and text do not change. Images are re-encoded as JPEG, so photos can look softer, especially with a small target. Keep the original and compare.
- Can I run Compress twice for more savings?
- Rarely. A second pass at the default level on an already-compressed file barely changes anything; set a smaller target size instead.
Last updated:
Call this from code
Every tool on this site is a plain REST endpoint - no account or API key needed for anonymous use. Built for AI agents and developers as much as for browsers.
curl -X POST "https://pdf123.xyz/api/v1/misc/compress-pdf" \
-F "[email protected]" \
-o output.pdfAlso available as an MCP tool for agent clients that speak Model Context Protocol (JSON-RPC 2.0 over POST /mcp). Full API reference
Use it from an AI agent
SkillClaude Code, Codex, Cursor and other AI agents can run Compress for you with this skill: /skills/pdf123-compress.md
Files are used only for this processing job and deleted automatically afterward.