Your files never leave your device. All processing happens locally in your browser.
How do I compress a PDF to 2MB (under 2 MB) online without uploading the file?
Open Compress PDF to 2MB and drop your PDF onto the page — the target is already locked to 2 MB (2048 KB), so there is nothing to configure. The tool renders every page in your browser with Mozilla’s pdf.js, re-encodes the images at a lower resolution and JPEG quality and rebuilds the document with pdf-lib, aiming to land at or just under 2 MB. Because 2 MB is a roomy target — far more generous than the KB presets or a 1 MB cap — the compression is usually very gentle, so scanned pages stay crisp and most documents keep their text selectable and searchable. It produces three quality variants in one pass — Best Quality, Balanced and Smallest — and marks each with a check when it meets the 2 MB cap, then shows the before/after sizes and the exact percentage saved. A typical report, scan or slide deck drops under 2 MB while looking almost untouched; only a very large, image-heavy file (tens of megabytes of high-resolution scans) is squeezed harder, and if it cannot quite reach 2 MB the tool tells you the smallest size it achieved. Everything runs in the tab, so nothing is uploaded and your PDF never leaves your device; the result downloads as your file name with a -compressed.pdf suffix.
Target locked to 2 MB (2048 KB) — drop a PDF and it compresses to fit that cap, with no settings to pick
Three quality variants in one pass (Best Quality, Balanced, Smallest), each tagged with a check when it lands under 2 MB
A generous target, so compression is near-lossless for most files — scans stay sharp and text usually stays selectable
Runs entirely in the browser with pdf.js and pdf-lib — no upload, no install, no account
Ideal for the common 2 MB per-document cap on visa portals (BLS, VFS), USCIS and other government and job-application forms
What is
Compress PDF to 2MB
Compressing a PDF to 2MB means reducing the document’s file size until it is at or under 2 megabytes (2048 kilobytes), one of the most common per-document upload ceilings on visa application portals, government e-forms and online job applications. Because most of a PDF’s weight is usually its images and scanned pages, a compressor reaches such a target mainly by down-sampling those images to a lower resolution (DPI) and re-encoding them with lossy JPEG compression; stripping metadata and converting pages to grayscale free up further bytes. At 2 MB the target is comparatively generous, so the compression is far gentler than at a 500 KB, 200 KB or 1 MB cap — scanned certificates stay crisp and most documents keep their text selectable rather than being flattened into images. Whether 2 MB is achievable depends on the content: an ordinary report, scan or presentation slips under 2 MB comfortably, while a very long, photo-heavy scan running to tens of megabytes may need a firmer squeeze. This tool locks the target to 2 MB, renders the pages with Mozilla’s pdf.js and rebuilds the file with pdf-lib entirely on your device, so no cloud service is involved and the PDF is never uploaded.
PDF Tools
Related terms
PDF2MBfile sizecompressionlossyDPIJPEG qualitydownsamplinggrayscalemetadatapdf.jspdf-libscanned PDFupload limitvisa portalapplication form
Frequently Asked Questions
No. The PDF is read and compressed to 2 MB entirely in your browser, so the file never leaves your device — there is no upload, server or account.
Nothing is uploaded. When you drop or pick a PDF, the tool reads it locally with the browser’s File API, renders its pages in memory with the pdf.js engine (whose worker is bundled locally, not fetched from a CDN) and rebuilds the compressed file with the pdf-lib library on your own machine. There is no server, upload, database, API or tracking in the processing path, so passports, bank statements, offer letters and private paperwork you are shrinking for a visa or job form stay on your device; the tool works offline once cached, and closing the tab discards everything. The only optional network use anywhere on the site is consent-gated advertising, which never sees your files.
Usually not much. 2 MB is a generous target, so the compression is gentle — scans stay crisp and most documents keep their text selectable, unlike a tight 200 KB or 500 KB squeeze.
At 2 MB the tool rarely has to work hard. Reaching any target uses lossy compression — images are down-sampled to a lower DPI and re-encoded as JPEG — but because 2 MB is far roomier than the KB presets or a 1 MB cap, the downward sweep of quality often stops early, so a report, scan or slide deck lands under 2 MB looking almost untouched and typically keeps its text live and searchable. Three variants are generated in one pass (Best Quality, Balanced and Smallest) and the tool defaults to the best one that still fits. Only a very large, image-heavy file — tens of megabytes of high-resolution scans — is compressed firmly enough that fine detail softens; even then the result stays legible, and if you need maximum fidelity you can pick the Best Quality variant.
2 MB per document is one of the most common caps on visa application portals (BLS, VFS and country-specific sites), USCIS and National Visa Center forms, and many government and online job applications.
A 2 MB per-file ceiling shows up constantly on visa and immigration systems — BLS and VFS Global visa portals, country-specific visa sites and US Department of State / National Visa Center document uploads (for example supporting documents attached to an I-864) frequently cap each scanned file at 2 MB. It is equally common on government e-service forms and on online job and admission applications that ask for a CV, certificates or ID under 2 MB. This tool targets that exact number: drop your PDF and download a version that clears 2 MB, then attach it with confidence. If a portal specifies a tighter limit, a 1 MB or smaller KB preset is one click away, and looser caps (3 MB, 4 MB, 5 MB and up) have their own presets.
Yes. It runs entirely in your browser on any modern phone, tablet or computer, and works offline once the page has been cached — no app or install needed.
The tool is 100% client-side, so it works in any modern browser on Android, iPhone, iPad, Windows, macOS or Linux without installing anything. Because the compression happens on your own device with pdf.js and pdf-lib, it keeps working offline once the page has loaded once — useful when you are finishing a visa or job application on patchy Wi-Fi. One PDF is processed at a time and the practical size ceiling is your device’s memory, so a very large scan is bounded by available RAM; on a phone, extremely heavy files may compress more slowly, but for the ordinary documents that need to fit a 2 MB box it is quick and stays entirely on the device.
Detailed Explanation
📖How It Works
Compressing a PDF to 2 MB — Entirely in the Browser
Compress PDF to 2MB shrinks a document to a fixed 2 megabyte (2048 KB) target without uploading a single byte. The 2 MB target is read from the page URL and locked, so there is nothing to choose — drop your PDF and the tool goes to work. It renders every page in the browser with Mozilla’s pdf.js, re-encodes the embedded images at a lower resolution and JPEG quality, and rebuilds the file with pdf-lib, aiming to land at or just under 2 MB. Because 2 MB is a generous ceiling — far roomier than the KB presets or a 1 MB cap — the downward sweep of DPI and quality usually stops early, so scanned pages keep most of their sharpness and most documents meet the cap without whole pages being flattened into images, leaving their text selectable. Three quality variants are produced in a single pass — Best Quality, Balanced and Smallest — and each is tagged with a check when it clears the cap, alongside the original versus new size and the exact percentage saved. An ordinary report, scan or slide deck slips under 2 MB comfortably; a very large, photo-heavy scan is squeezed harder, and if 2 MB is genuinely out of reach the tool reports the smallest size it achieved rather than producing an unreadable file. Everything runs on your device, so the PDF never leaves the tab.
2 MB (2048 KB) target locked from the URL — drop a PDF, no settings to pick
Renders with pdf.js, re-encodes images at lower DPI/JPEG quality, rebuilds with pdf-lib in the browser
Three variants in one pass (Best Quality, Balanced, Smallest), each marked when it meets 2 MB
Generous target, so compression is near-lossless — most files keep selectable text; reports the smallest achievable size when a huge scan cannot reach 2 MB
📋Use Cases
When a 2 MB PDF Is Required
A 2 MB per-document limit is one of the most widespread upload ceilings on the web, and it dominates visa and immigration paperwork in particular. BLS and VFS Global visa portals, country-specific visa sites and US Department of State / National Visa Center document uploads — such as the supporting documents attached to an Affidavit of Support (I-864) — frequently cap each scanned file at 2 MB and reject anything larger. The same limit is common on government e-service forms and on online job and admission applications that request a CV, certificates or ID under 2 MB. Because 2 MB is a comfortable amount of room, this tool can clear the cap while barely touching quality, so a scanned passport, bank statement or set of certificates stays crisp and readable at the far end. You drop the PDF and download a version that clears 2 MB, then attach it with confidence. When a portal specifies a tighter limit, a 1 MB or smaller KB preset is one click away, and looser caps — 3 MB, 4 MB, 5 MB and beyond — have their own presets.
2 MB per document is a common cap on visa portals such as BLS and VFS Global and country-specific visa sites
US Department of State / National Visa Center uploads (e.g. documents supporting an I-864) frequently cap scanned files at 2 MB
Also common on government e-forms and online job / admission applications requesting a CV, certificates or ID
Sibling presets cover 1 MB and smaller KB targets for tighter caps and 3 MB, 4 MB, 5 MB and up for looser ones
🔧Technical Details
How the 2 MB Target Is Reached
When the page loads at /compress-pdf-to-2mb, a URL parser (getPdfPresetFromPath) matches the “2mb” token, converts the megabyte value to kilobytes and fixes the target at 2048 KB, showing a locked-target banner (“Target: 2 MB”) instead of the usual preset grid. On drop, the PDF is read into an ArrayBuffer with the File API and pdf.js (pdfjs-dist) renders a first-page thumbnail and the page count, its worker bundled with the app locally rather than fetched from a CDN. Smart Compress hands the buffer and options { targetKB: 2048, grayscale, removeMetadata } to the smartCompressPDF routine (src/lib/workerClient.ts), which pursues two strategies and keeps whichever yields the smaller file that still meets 2 MB: it re-encodes the PDF’s embedded images at reduced JPEG quality and scale, and, when a target needs it, rasterises whole pages by having pdf.js paint each page onto an HTML canvas at a chosen DPI, encoding the canvas as JPEG and assembling a fresh PDF from those images with pdf-lib. Because 2 MB is a roomy ceiling, the sweep of DPI and JPEG quality usually stops very early — the Best variant frequently lands under the cap with little visible loss, and most files fit with their text left live, so it is kept as the default. Three configurations run in one pass — Best Quality (highest DPI and JPEG quality), Balanced, and Smallest — and metadata is stripped by default. Each variant is measured, tagged when it lands under 2 MB, and the chosen one downloads from a local Blob with a -compressed.pdf suffix.
getPdfPresetFromPath parses the URL, converts 2 MB to 2048 KB and locks the target
pdf.js (pdfjs-dist) reads the page count and renders the thumbnail; its worker is bundled locally, not from a CDN
smartCompressPDF re-encodes images and, when needed, rasterises pages via canvas, rebuilding with pdf-lib
Three variants generated and measured in one pass; the chosen file downloads from a local Blob
⚠️Limitations
Honest Limitations
Whether 2 MB is reachable depends on the content, but the target is generous enough that the vast majority of documents clear it easily. An ordinary report, form, scan or slide deck drops under 2 MB with room to spare and stays crisp; only a very large, photo-heavy file — a long scan running to many tens of megabytes — has a physical floor, and past a point the tool stops at the smallest legible size it can produce and surfaces a warning naming that figure rather than returning junk. The real savings come from lossy compression, so there is a genuine trade-off — when the tool must rebuild pages as JPEG images to hit a target, the text on those pages becomes part of the picture and no longer selectable or searchable; but 2 MB is roomy enough that this step is rarely needed, so most documents keep their text live, and if you need guaranteed fidelity a larger target is gentler still. Everything runs in browser memory, so a very large or high-page-count PDF is bounded by your device’s RAM, and the tool compresses one PDF at a time rather than a batch. The file must be openable by pdf.js and pdf-lib — a password-protected or corrupt document reports a clear, auto-dismissing error instead of a broken result. If a huge scan will not fit, removing spare pages or splitting the document first usually gets you under the cap.
Most documents reach 2 MB with room to spare; only a huge photo-heavy scan may bottom out above it, and the smallest achieved size is reported
Aggressive rebuilds rasterise pages, so their text becomes part of the image; at 2 MB this is rarely needed, so text usually stays selectable
In-browser processing bounded by device RAM; one PDF at a time, not a batch
Password-protected or corrupt files report a clear error; removing pages or splitting helps a stubborn scan fit
🔒Privacy & Security
Privacy: Your PDF Never Leaves the Tab
The documents people compress for a 2 MB upload box are often the sensitive kind — passports, visa paperwork, bank statements, offer letters, signed forms — and this tool is built so none of it leaves your machine. The file is read with the browser File API, rendered entirely in memory with pdf.js (whose worker is bundled locally, so no third-party CDN is contacted), and the compressed document is rebuilt with pdf-lib on your own device. There is no server, upload, database, logging, API or CDN anywhere in the processing path, and the finished PDF is generated locally and downloaded straight from a Blob. The tool works offline once the page has been cached, and closing the tab discards every byte. There is no login and no telemetry, and the only optional network use anywhere on the site is consent-gated advertising, which never sees your files.
PDF read, rendered and rebuilt entirely in the browser; nothing uploaded
No server, upload, database, API or CDN in the processing path; pdf.js worker bundled locally
Compressed PDF built on-device and downloaded from a local Blob; works offline once cached
No login or telemetry; closing the tab discards everything
Compress PDF to 2MB — target, quality and limits
Capability
Support
Notes
Target size
Locked at 2 MB (2048 KB)
Parsed from the URL; a banner replaces the preset grid so there is nothing to configure
Quality variants
Best, Balanced, Smallest
Three generated in one pass; each tagged with a check when it lands at or under 2 MB
Method
Image re-encode + page rasterise
pdf.js renders pages, images are down-sampled and JPEG-re-encoded, and pdf-lib rebuilds the file
Fidelity
Generous, so near-lossless for most files
The sweep usually stops early at 2 MB, so scans keep detail and documents keep selectable text
Hard cases
Reports smallest achievable
Ordinary documents clear 2 MB easily; only a huge photo-laden scan stops at the smallest legible size with a warning
Privacy & scale
In-browser, bounded by RAM
Compressed with pdf-lib on-device, one PDF at a time; 100% client-side, no upload
Compress PDF to 2MB locks the target at 2 MB / 2048 KB (parsed from the URL) and rebuilds the document in the browser: pdf.js renders the pages, images are down-sampled and JPEG-re-encoded, and pdf-lib assembles the result, producing three variants (Best, Balanced, Smallest) each marked when it clears 2 MB. Because 2 MB is roomy, the compression is usually near-lossless, so scans keep detail and most documents meet the cap without rasterising pages, keeping text selectable; ordinary files reach it easily, while a huge photo-heavy scan stops at the smallest legible size with a warning. Reaching the target is lossy, so any rasterised pages lose selectable text. Everything runs on-device; nothing is uploaded.