← Back to Blog

Guide · Feb 2026 · 10 min read

How to Merge PDF Files Without Uploading to a Website

You have a contract, an addendum, and a signature page in three separate PDFs. You need one file. Every search result points to a website that wants you to upload your documents to their servers. Here is how to merge locally instead.

Why you should not upload sensitive PDFs

The top search results for "merge PDF" are all online tools: iLovePDF, Smallpdf, Adobe Acrobat Online, PDF Merge, and dozens of others. They work. But they require uploading your files to a remote server. For vacation photos, that is fine. For the following types of documents, it is a real problem.

  • Legal documents: Contracts, NDAs, settlement agreements, court filings. Attorney-client privilege means nothing if the document sits on a third-party server.
  • Financial records: Tax returns, bank statements, investment summaries, pay stubs. These contain Social Security numbers, account numbers, and income details.
  • Medical records: HIPAA-covered documents, insurance claims, lab results, prescriptions. Uploading these to a random website may violate federal regulations.
  • Business confidential: Board presentations, M&A documents, product roadmaps, patent applications. Competitive intelligence lives in these files.
  • Identity documents: Passport scans, driver's license copies, visa applications. The raw material for identity theft.
  • Client work: If you handle documents for clients under GDPR, SOC 2, or other compliance frameworks, sending their data to an unvetted third-party processor is a policy violation.

Most online PDF tools have privacy policies that allow them to retain uploaded files for a period (typically 1-24 hours). Some are transparent about this. Others are not. Even if they delete files promptly, the upload itself transits the internet unencrypted (the HTTPS connection terminates at their server, where the file exists in plaintext). The PDF format can contain embedded fonts, images, form data, JavaScript, and metadata that may reveal more than you intend.

Local merging eliminates all of these concerns. The files never leave your machine.

Methods by platform

Every major operating system provides at least one built-in or free way to merge PDFs locally. Here is a comparison of what is available.

MethodPlatformCostBatch SupportPage ReorderingCommand Line
macOS PreviewmacOSFree (built-in)Manual (drag and drop)Yes (drag thumbnails)No
ConvXmacOS, Windows, Linux$20YesBy argument orderYes
qpdfmacOS, Windows, LinuxFree (open source)YesYes (page ranges)Yes (CLI only)
pdftkmacOS, Windows, LinuxFree (open source)YesYes (page ranges)Yes (CLI only)
GhostscriptmacOS, Windows, LinuxFree (open source)YesLimitedYes (CLI only)
Adobe AcrobatmacOS, Windows$22.99/monthYesYes (full GUI)No
Python (PyPDF)AnyFreeScriptableFully programmableVia script

macOS Preview (built-in, free)

macOS Preview is the fastest option if you are on a Mac and need to merge a few files with no tools to install.

  1. Open the first PDF in Preview.
  2. Go to View, then Thumbnails (or press Cmd+Option+2) to show the sidebar with page thumbnails.
  3. In Finder, select the second PDF file. Drag it into the Preview thumbnail sidebar. Drop it at the position where you want it inserted (between existing pages, or at the end).
  4. Repeat for additional PDFs.
  5. Go to File, then Export as PDF. Save the merged file.

This works reliably for 2-5 files. For larger merges (20+ files), it becomes tedious because you are dragging each file individually. There is no batch import. Preview also does not preserve all PDF features: form fields, annotations, and bookmarks may be lost or altered during the export step.

For more details on Preview's capabilities, see Apple's official guide to combining PDFs in Preview.

ConvX (all platforms)

ConvX handles PDF merging as part of its document conversion pipeline.

convx convert doc1.pdf doc2.pdf doc3.pdf --to pdf --merge

This merges all three PDFs into a single output file. The page order follows the argument order: all pages from doc1, then all pages from doc2, then all pages from doc3.

For merging an entire folder of PDFs (sorted alphabetically by filename):

convx convert "contracts/*.pdf" --to pdf --merge -d ./merged

The output file appears in the ./merged directory. If you need a specific filename:

convx convert doc1.pdf doc2.pdf --to pdf --merge -o combined-contract.pdf

ConvX preserves internal links, bookmarks, and form fields during the merge. For the full syntax, see the CLI reference.

Using the desktop app

Drag all PDF files into the ConvX window. Select "Merge" mode. Reorder files by dragging them in the list. Click merge. The output is a single PDF with all pages combined. The desktop app shows page count per file and total page count before you start, so you can verify everything looks right.

qpdf (free, open source)

qpdf is a command-line PDF tool that excels at structural manipulation: merging, splitting, rotating pages, and linearizing (optimizing for web viewing). It is fast because it operates on the PDF structure directly without rasterizing or re-rendering pages.

# Install
brew install qpdf          # macOS
sudo apt install qpdf      # Ubuntu/Debian
choco install qpdf          # Windows (Chocolatey)

# Merge
qpdf --empty --pages doc1.pdf doc2.pdf doc3.pdf -- merged.pdf

qpdf also supports page ranges, which is useful when you need specific pages from each file:

# Pages 1-3 from doc1, all pages from doc2, page 5 from doc3
qpdf --empty --pages doc1.pdf 1-3 doc2.pdf doc3.pdf 5 -- merged.pdf

qpdf is fast and reliable, but it is a CLI-only tool with no GUI. The syntax is slightly verbose, especially for simple merges.

pdftk (free, open source)

pdftk (PDF Toolkit) is one of the oldest and most well-known PDF command-line tools. It has been around since the early 2000s.

# Install
brew install pdftk-java    # macOS (Java-based port)
sudo apt install pdftk      # Ubuntu/Debian
# Windows: download from pdftk.com

# Merge
pdftk doc1.pdf doc2.pdf doc3.pdf cat output merged.pdf

pdftk's cat operation is intuitive and has been the go-to answer for "merge PDFs on the command line" for over a decade. It supports page ranges, rotation, encryption, and form filling.

The caveat: the original pdftk was written in C++ with iText. It was rewritten in Java (pdftk-java) and later ported to GCJ. Installation can be tricky on some platforms, and the Java dependency adds overhead. On macOS, brew install pdftk-java requires Java to be installed.

Ghostscript (free, open source)

Ghostscript is a PostScript and PDF interpreter. It is not designed primarily for merging, but it can do it.

gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite \
   -sOutputFile=merged.pdf doc1.pdf doc2.pdf doc3.pdf

Ghostscript works, but with an important caveat: it re-renders the PDF content. This means it processes every page through its rendering engine, which can alter fonts, change image compression, and subtly modify the output. For documents where exact fidelity matters (legal filings, signed contracts), this re-rendering may introduce unwanted changes. qpdf, pdftk, and ConvX operate on the PDF structure directly, preserving the original content byte-for-byte where possible.

Ghostscript is best used when you need to merge and simultaneously reduce file size, fix corrupted PDFs, or convert PDF versions. For simple merging, the other tools are more appropriate.

Python scripting (PyPDF)

For developers who need programmatic control, Python's PyPDF library (formerly PyPDF2) makes PDF merging a few lines of code:

from pypdf import PdfMerger

merger = PdfMerger()
merger.append("doc1.pdf")
merger.append("doc2.pdf")
merger.append("doc3.pdf")
merger.write("merged.pdf")
merger.close()

This is overkill for a one-off merge, but it is the right tool when merging PDFs is part of a larger automated pipeline (generating reports, assembling client packages, building documentation bundles). You get full control over page ranges, bookmarks, metadata, and encryption.

Page ordering strategies

Merging is simple when the order is obvious: doc1 first, doc2 second. But real-world scenarios are more complex.

Alphabetical by filename

If your files are named with a logical prefix (001-cover.pdf, 002-chapter1.pdf, 003-appendix.pdf), sorting alphabetically gives the correct order. ConvX's glob pattern handles this naturally:

convx convert "book/*.pdf" --to pdf --merge -o book-complete.pdf

Files are processed in alphabetical order by default.

Custom order

When filenames do not sort naturally, specify them explicitly:

convx convert cover.pdf toc.pdf chapter1.pdf chapter2.pdf appendix.pdf --to pdf --merge -o manuscript.pdf

The merge order matches the argument order.

Interleaving pages from two documents

A common need: you scanned double-sided pages with a single-sided scanner, producing one PDF with all front pages and another with all back pages (in reverse order). Tools like qpdf and pdftk support page interleaving. For ConvX, merge the documents in sequence and note that interleaving is not yet supported natively. Use qpdf for this specific case:

qpdf --collate --empty --pages fronts.pdf backs.pdf -- interleaved.pdf

Handling mixed page sizes

Merging a letter-size contract with an A4 appendix and a legal-size signature page produces a PDF with mixed page sizes. This is technically valid. PDF supports different page sizes within a single document. Most PDF viewers handle it correctly.

However, printing a mixed-size PDF can be problematic. Printers may scale pages unexpectedly, add margins, or skip pages that do not match the paper tray. If the merged document will be printed, consider normalizing page sizes before merging.

ConvX and qpdf both preserve original page sizes during merging. They do not resize or crop pages. What goes in is what comes out.

Reducing file size after merging

Merged PDFs can be large, especially when individual documents contain high-resolution images, embedded fonts, or redundant data. A merged file of 10 documents may have the same font embedded 10 separate times.

To reduce file size after merging:

# Using Ghostscript (most effective, re-renders content)
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 \
   -dPDFSETTINGS=/ebook -dNOPAUSE -dBATCH \
   -sOutputFile=compressed.pdf merged.pdf

The -dPDFSETTINGS flag controls the compression level:

SettingImage DPIUse CaseTypical Reduction
/screen72 DPIScreen viewing only. Very small files. Images will look pixelated when printed.60-80%
/ebook150 DPIGood balance. Readable on screen and acceptable for casual printing.40-60%
/printer300 DPIPrint quality. Good for documents that will be printed at standard sizes.20-40%
/prepress300 DPI, color preservedProfessional printing. Preserves color profiles and highest image quality.10-20%

qpdf can also optimize PDFs without re-rendering:

qpdf --linearize --object-streams=generate merged.pdf optimized.pdf

This removes redundant objects and optimizes the internal structure. It does not re-compress images, so the reduction is smaller (5-15%), but fidelity is perfectly preserved.

Merging encrypted or password-protected PDFs

PDFs can have two types of passwords: an owner password (restricts editing, printing, copying) and a user password (restricts opening the file). If a PDF has an owner password but no user password, most tools can open and merge it. The owner password restrictions are advisory; they rely on the PDF viewer to enforce them.

If a PDF has a user password, you must supply the password to open it before merging. qpdf handles this:

qpdf --password=secret --decrypt protected.pdf decrypted.pdf
qpdf --empty --pages decrypted.pdf other.pdf -- merged.pdf

ConvX prompts for passwords when it encounters protected PDFs during a merge operation. The password is used locally to decrypt the file; it is never transmitted anywhere.

Preserving bookmarks and links

PDFs often contain bookmarks (the clickable table of contents in the sidebar) and internal links (clickable references that jump to other pages). When merging, these features can break if the tool does not update the internal page references.

ConvX and qpdf both preserve and update bookmarks during merging. Each source document's bookmarks appear as a section in the merged document's bookmark tree. Internal links within each document continue to work. Cross-document links (links from doc1 to a page in doc2) are not supported by any tool during merge because there is no way to know that the documents were related before merging.

Ghostscript does not preserve bookmarks during merging. If bookmarks matter, use a different tool.

Automating recurring merges

Some workflows involve regular PDF merging: monthly financial reports, weekly meeting minutes, daily scan batches. ConvX's MCP server enables AI agents to handle these tasks automatically.

A practical example: you receive invoices by email, save them to a folder, and need a combined PDF at the end of each month. ConvX's watch mode can monitor the folder:

convx watch ~/Documents/Invoices --to pdf --merge --filter "*.pdf"

Or set up a cron job to merge at the end of each month:

# crontab entry: merge all PDFs on the last day of each month
0 18 28-31 * * [ "$(date +\%d -d tomorrow)" = "01" ] && convx convert ~/Documents/Invoices/*.pdf --to pdf --merge -o ~/Documents/monthly-invoices-$(date +\%Y-\%m).pdf

Windows-specific methods

Windows does not have a built-in PDF merge tool. Microsoft Print to PDF can combine documents, but only by printing them to a new PDF, which re-renders everything and often degrades quality.

The most practical free option on Windows is installing qpdf or ConvX. PowerShell does not have native PDF support. If you have Adobe Acrobat (the full version, not Reader), it can merge PDFs through its Combine Files feature, but at $22.99 per month, it is expensive for a feature that free tools handle equally well.

ConvX's Windows installer adds the CLI to your PATH automatically, so you can run merge commands from PowerShell or Command Prompt immediately after installation.

Linux-specific methods

Linux has the richest set of free PDF tools. Beyond qpdf, pdftk, and Ghostscript (all available via apt/dnf/pacman), there are GUI options.

PDF Arranger is a GTK-based GUI tool for reordering, rotating, cropping, and merging PDF pages. It is available in most distribution repositories: sudo apt install pdfarranger. It shows page thumbnails and lets you drag pages between documents.

LibreOffice Draw can open PDFs and export to PDF, but it re-renders content and may alter formatting. It is not recommended for merge operations.

Troubleshooting

Merged PDF is much larger than the sum of the originals

This usually happens when the merge tool re-renders content (Ghostscript with default settings, or "Print to PDF" on Windows). Each page gets re-compressed, and shared resources (fonts, images) get duplicated. Use a structural merge tool (qpdf, pdftk, ConvX) instead. If the file is still too large, run the Ghostscript compression command from the "Reducing file size" section above.

Fonts look different after merging

If one source PDF has embedded fonts and another relies on system fonts, the merged document may display inconsistently. The fix: ensure all source PDFs have embedded fonts before merging. You can check with qpdf --show-object=all input.pdf or by opening the file properties in Adobe Reader (File, then Properties, then Fonts tab). If fonts are not embedded, re-export the original document with font embedding enabled.

Blank pages appear in the merged output

Some PDFs contain trailing blank pages that are not visible in the viewer's default view. When merged, these blank pages become obvious. Remove them before merging using qpdf:

# Remove the last page (if blank)
qpdf doc1.pdf --pages doc1.pdf 1-r2 -- doc1-trimmed.pdf

The 1-r2 syntax means "page 1 through the second-to-last page" (r2 counts from the end).

Form fields do not work after merging

Interactive PDF form fields (text inputs, checkboxes, dropdowns) have internal names. If two source PDFs have form fields with the same names (common when merging multiple copies of the same form), the fields may conflict in the merged output. qpdf can flatten form fields before merging: qpdf --flatten-all input.pdf flattened.pdf. This converts form fields to static content, which prevents conflicts but makes the fields non-editable.

Page orientation is wrong

Some PDFs have a rotation flag in their metadata that tells the viewer to display the page rotated. When merging, this flag is preserved. If a page appears rotated in the merged output, it was rotated in the source. Fix it with qpdf before merging: qpdf --rotate=+0:1 input.pdf fixed.pdf (resets rotation for page 1).

Merge PDFs without uploading anything. Combine, reorder, and export locally. Your documents stay on your machine. Get ConvX for $20 →

Related articles