Every time I needed to split a bank statement, extract a few pages from a contract, or merge two PDFs, I ran into the same uncomfortable tradeoff: most popular online PDF tools ask you to upload your files to a remote server first.
Even when a site promises to delete files after an hour, uploading sensitive documents—tax forms, invoices, ID scans, legal agreements—to a third-party server just to split a few pages never felt right. And on top of the privacy concern, server-side processing costs money, which is why most online PDF tools eventually add file size limits, daily quotas, watermarks, or sign-up walls.
So I built ChopPDF: a free web tool that splits, extracts, and merges PDFs 100% client-side inside your browser, with zero file uploads.
Why Client-Side PDF Processing Makes Sense
Splitting, reordering, and merging PDFs does not require heavy server-side rendering or OCR. At its core, a PDF is a structured container of objects and a page tree. Copying selected page objects into a new PDF document is mostly byte-level manipulation in memory.
Modern browsers already give us everything needed to do this fast and safely on the user's own device:
-
File.arrayBuffer()to read local files directly into memory without touching the network - Mature client-side PDF libraries (such as
pdf-lib) to parse, copy, and assemble pages in JavaScript -
BlobandURL.createObjectURL()to trigger instant local downloads - Client-side ZIP packaging when splitting a multi-page document into individual files
How the Local Pipeline Works
The entire workflow stays inside the browser tab:
import { PDFDocument } from 'pdf-lib';
// 1. Read the PDF directly from the user's file input (no fetch / upload)
const bytes = await file.arrayBuffer();
const srcDoc = await PDFDocument.load(bytes);
// 2. Create a new PDF containing only the selected 0-based page indices
const selectedIndices = [0, 2, 3];
const outDoc = await PDFDocument.create();
const copiedPages = await outDoc.copyPages(srcDoc, selectedIndices);
copiedPages.forEach((page) => outDoc.addPage(page));
// 3. Serialize to bytes and trigger a local download
const outBytes = await outDoc.save();
const blob = new Blob([outBytes], { type: 'application/pdf' });
const url = URL.createObjectURL(blob);
const a = document.createElement('a');
a.href = url;
a.download = 'extracted-pages.pdf';
document.body.appendChild(a);
a.click();
a.remove();
// 4. Defer revoking the Blob URL so async downloads finish cleanly in Safari/Firefox
setTimeout(() => URL.revokeObjectURL(url), 1000);
When splitting every page of a document into separate numbered PDFs, each page is generated in memory and bundled into a single .zip archive locally so the browser only triggers one clean download instead of spamming dozens of download prompts.
One caveat worth calling out early is encrypted PDFs. Passing PDFDocument.load(bytes, { ignoreEncryption: true }) only bypasses metadata-level permission flags (an owner password with no open password). If a document requires an actual user password to open, skipping that flag will not decrypt the content stream—exporting pages will fail or produce blank/corrupted output, so it is much safer to check srcDoc.isEncrypted upfront and show a clear message.
Practical Lessons Learned
-
Always clean up object URLs and buffers: Large scanned PDFs can easily be 50–100 MB. Revoking Blob URLs after download and avoiding duplicate copies of
Uint8Arraybuffers keeps tab memory usage predictable. -
Make page selection effortless: Supporting simple custom ranges when users need to extract pages from a PDF in a custom order (like
4, 1-2)—or merge PDF files locally without hitting file-count paywalls—covers most real-world document workflows without cluttering the UI. - Zero server compute = sustainable free tool: Because there is no backend processing queue or storage bill scaling with user files, the tool can stay free without accounts, upload caps, or watermarks—even on locked-down work laptops or Chromebooks where installing desktop software is not an option.
Verify It Yourself
If you want to test it—or verify that no file data leaves your browser—open Chrome DevTools, switch to the Network tab, open ChopPDF, and drop in a PDF (you can even turn off Wi-Fi after loading the page—splitting, extracting, and merging still work completely offline with zero upload requests).
I would love to hear feedback from fellow developers—especially edge cases you have hit with malformed PDFs, non-standard fonts, or huge scanned documents in the browser!
Top comments (1)
Quick real-world benchmark for anyone curious how client-side
pdf-libholds up on larger image-heavy files—I just timed a 50.4 MB (48.1 MiB), 100-page image-stream PDF in Chromium on Windows:File.arrayBuffer()parse + page-tree load (with page thumbnails):514–618 ms4, 1-2→4 → 1 → 2, outputting a1.51 MBPDF):400 ms.zippackaging (50.5 MBarchive):1,525 ms(~1.53 s)0(0 bytesuploaded)For comparison, on a typical home/office upload connection, just uploading a 50 MB PDF to a remote server and downloading the output ZIP takes 8–15+ seconds of network I/O alone—before any server queue time. Keeping the whole pipeline in browser memory makes large splits noticeably faster as well as private.
If anyone runs into slower times on specific PDF structures (like deeply nested form XObjects or huge JBIG2/JPEG2000 scans), let me know!