Short answer: use pdfunite to merge PDFs on Linux. One command merges any number of PDFs in the order you list them, and in my test it was the fastest of the three tools I tried. If you are already writing a Python script — say, merging files as part of a larger workflow — pypdf and pikepdf do the same job from inside your code, with pikepdf producing the smallest output file. The exact commands for all three are below, and none of them requires uploading your documents to a website.

The test: merging PDFs on Linux with 3 tools, one check

To compare fairly, every tool started from the same files. I generated three test PDFs on this machine: Document A with 4 pages, Document B with 3 pages, and Document C with 3 pages — 10 pages in total. Each page carried a label like "Document A - page 1 of 4" so I could check not just the page count but the exact order after merging. I also built a larger set — three 100-page PDFs, 300 pages in total — to get timing numbers that are not just program startup time.

The tools, with the versions I actually ran on November 1, 2026: pdfunite from Poppler 24.02.0, pypdf 6.21.4, and pikepdf 10.17.0, on a 4-core Linux virtual machine. After each merge I checked the result two ways: pdfinfo for the page count, and pdftotext to confirm the first and last pages were what they should be.

The results

Tool 10-page merge 300-page time (median of 3 runs) 300-page output size
pdfunite 10 pages, correct order 0.026 s 180,670 bytes
pypdf 10 pages, correct order 0.101 s 161,047 bytes
pikepdf 10 pages, correct order 0.029 s 143,517 bytes

Every tool passed the correctness check: all three outputs had exactly 10 pages, started with "Document A - page 1 of 4" and ended with "Document C - page 3 of 3", and the text extracted cleanly from every page. On speed, pdfunite and pikepdf were effectively tied (0.026 s vs 0.029 s for 300 pages), while pypdf took about four times as long — still only a tenth of a second, so for ordinary documents the speed difference is irrelevant. On size, pikepdf came out smallest in both tests: 5,539 bytes for the 10-page merge, against 6,173 for pypdf and 7,034 for pdfunite.

One honest caveat: my test PDFs are simple text pages. Real documents with scanned images or embedded fonts will be much larger and slower to process, and the size ranking could shift, because each writer stores PDF objects slightly differently. What the test does prove is the part that matters most: all three tools preserve every page, in order, without damaging the content.

Method 1: pdfunite (fastest, simplest)

pdfunite comes with Poppler, the PDF library behind many Linux PDF tools, and on Ubuntu or Debian it is installed with the poppler-utils package:

sudo apt install poppler-utils

The merge itself is a single command. List the input files in the order you want their pages to appear, then the output file last:

pdfunite doc-a.pdf doc-b.pdf doc-c.pdf merged.pdf

That is the whole method. There is no configuration and no script to maintain, which is why it is my recommendation for a one-off merge. Two details are worth knowing: the output file must be a new filename, not one of the inputs, and pdfunite simply concatenates pages — it does not re-render them, which is why the text in my test survived untouched.

Method 2: pypdf (best if you already use Python)

pypdf is a pure-Python PDF library, so it installs with pip and needs no system packages:

pip install pypdf

The merge script is short. PdfWriter.append() adds a whole file at a time, in the order you call it:

from pypdf import PdfWriter

writer = PdfWriter()
for path in ["doc-a.pdf", "doc-b.pdf", "doc-c.pdf"]:
    writer.append(path)
with open("merged.pdf", "wb") as f:
    writer.write(f)

pypdf was the slowest in my test, but "slowest" here means a tenth of a second for 300 pages — nothing you would notice. Its real advantage is flexibility: because the merge lives inside Python, you can generate the file list from a folder, filter by name, or add the merge as one step in a script that also renames, moves, or emails the result. If you do not already use Python, though, there is no reason to reach for it over pdfunite.

Method 3: pikepdf (smallest output, nearly as fast)

pikepdf is also a Python library, but unlike pypdf it wraps the C++ qpdf engine, which is why it is both fast and compact in its output. Install it with pip:

pip install pikepdf

The merge copies each source file's pages into a new document:

import pikepdf

pdf = pikepdf.Pdf.new()
for path in ["doc-a.pdf", "doc-b.pdf", "doc-c.pdf"]:
    with pikepdf.Pdf.open(path) as src:
        pdf.pages.extend(src.pages)
pdf.save("merged.pdf")

pikepdf matched pdfunite on speed (0.029 s vs 0.026 s for 300 pages) and produced the smallest file in both of my tests — about 21% smaller than pdfunite's 300-page output. The tradeoff is a lower-level API: it follows the structure of the PDF file itself, so for anything beyond a simple merge you will need to know a bit more about PDFs than pypdf asks of you. For a plain merge, though, the script above is all there is to it.

Which should you pick?

  • Merging files by hand, once: pdfunite. One command, fastest in my test, nothing to install beyond poppler-utils.
  • Merging as part of a Python script: pypdf if you want the simplest pure-Python code, pikepdf if you also care about output size or speed.
  • Big batches on a schedule: any of the three — at these speeds, even hundreds of pages finish in well under a second on text documents, so pick the one that fits your workflow, not the stopwatch.

Whichever you choose, keep the originals until you have opened the merged file and spot-checked the first and last pages. Merging is non-destructive to the inputs — none of these commands touches the source files — but a two-second check beats discovering a wrong page order after you have sent the document on.

FAQ

Will merging reduce the quality of my PDFs? No, not with these tools. Merging concatenates pages; it does not re-render them. In my test the text extracted from the merged files exactly as it did from the originals, and no page was resized or recompressed.

Does the page order follow the order I list the files? Yes. I verified this directly: listing A, then B, then C produced a file starting with Document A page 1 and ending with Document C page 3, for all three tools. To change the order, just change the order of the arguments or the list in the script.

Can I merge more than three files? Yes. pdfunite accepts as many input files as you list, and both Python scripts loop over a list of any length. I tested with three files, but the pattern extends unchanged.

What if a PDF is password-protected? That case was not part of my test — all of my test files were unprotected — so I will not claim a specific command for it here. Unlock or decrypt the file first, then merge the unlocked copy with any of the methods above.

Conclusion

Merging PDFs on Linux needs no website upload and no paid app: pdfunite merged my test files in a single command and was the fastest of the three tools, pypdf is the easiest option inside a Python script, and pikepdf matched pdfunite on speed while producing the smallest file. All three kept every page in the right order. Pick pdfunite for the job itself, and reach for the Python libraries only when the merge is one step in a bigger script.

How this article was made

On November 1, 2026, I generated test PDFs with ReportLab (Document A: 4 pages, Document B: 3 pages, Document C: 3 pages, plus three 100-page PDFs for timing) and merged them with pdfunite from Poppler 24.02.0, pypdf 6.21.4, and pikepdf 10.17.0 on a 4-core Linux virtual machine. I verified each 10-page output with pdfinfo (exactly 10 pages) and pdftotext (first page Document A page 1, last page Document C page 3), and timed each 300-page merge three times, reporting the median. Tool documentation was consulted for the exact commands and API usage: the Poppler project, the pypdf documentation, and the pikepdf documentation. This article was drafted with AI assistance (Tiny, UnlockProof's AI assistant) and every number above comes from the test run described here.

Sources: Poppler · pypdf documentation · pikepdf documentation