Use PDF Merger

Enter your data below to use the PDF Merger

📌 Try these examples:
RESULT

Last updated

How PDF Merging Works

PDF merging combines multiple PDF files into a single document by concatenating their page streams. Each PDF contains a cross-reference table (xref) that maps object numbers to byte offsets. When merging, the objects from each source PDF are renumbered to avoid conflicts, and a new xref table is written for the combined document.

PDF Structure Overview

Text
PDF file structure:
  %PDF-1.7          ← header
  1 0 obj           ← catalog object
  2 0 obj           ← pages tree
  3 0 obj           ← page 1
  4 0 obj           ← page 1 content stream
  ...
  xref              ← cross-reference table
  trailer           ← trailer dictionary
  %%EOF             ← end of file

Using pdf-lib in JavaScript

JavaScript
import { PDFDocument } from 'pdf-lib';

async function mergePdfs(pdfFiles) {
  const merged = await PDFDocument.create();

  for (const file of pdfFiles) {
    const bytes = await file.arrayBuffer();
    const pdf   = await PDFDocument.load(bytes);
    const pages = await merged.copyPages(pdf, pdf.getPageIndices());
    pages.forEach(page => merged.addPage(page));
  }

  const mergedBytes = await merged.save();
  const blob = new Blob([mergedBytes], { type: 'application/pdf' });
  const url  = URL.createObjectURL(blob);

  const a = document.createElement('a');
  a.href = url;
  a.download = 'merged.pdf';
  a.click();
}

Common Issues

Frequently Asked Questions

Simply enter your data, click the process button, and get instant results. All processing happens in your browser for maximum privacy and security.

Yes! PDF Merger is completely free to use with no registration required. All processing is done client-side in your browser.

Absolutely! All processing happens locally in your browser. Your data never leaves your device, ensuring complete privacy and security.