ByteCompress

Search Tools

Search for a tool by name

Merge PDF

Merge PDF combines multiple PDF files into a single document right in your browser. The process runs entirely client-side, ensuring your files remain private and secure on your device.

Drop PDF files here or

PDF only (max 20 files) - up to 1GB

Merge PDF is a browser-based tool that merges multiple PDF files into one without uploading any data to a server. Utilizing the pdf-lib JavaScript library, it efficiently handles input files up to approximately 500MB total size while preserving page dimensions, annotations, and embedded fonts. Since all processing occurs locally, your documents never leave your device, enhancing privacy. For additional PDF tasks, you can use related tools like Split PDF to divide documents or Compress PDF to reduce file sizes.

How to Use Merge PDF

  1. Click or drag-and-drop your PDF files into the upload area.
  2. Arrange the files in the desired merge order by dragging the file thumbnails.
  3. Click the 'Merge' button to start combining the PDFs.
  4. Wait for the process to complete, which depends on total file size and number of pages.
  5. Download the merged PDF file to your device.

How It Works

This tool leverages the pdf-lib library's PDFDocument.copyPages() method to copy all pages from each source PDF into a new PDFDocument. It preserves page dimensions by maintaining the original media box settings, and keeps annotations and embedded fonts intact to ensure fidelity. The entire process is executed client-side in your browser's JavaScript engine, which means no file data is sent over the internet. Memory consumption scales with the total input size, with practical limits around 500MB, allowing merging of large documents with no fixed page count restrictions.

Example

// Input: Two PDF files - report1.pdf (10 pages), report2.pdf (5 pages)
// Output: merged_report.pdf (15 pages)

const mergedPdf = await PDFDocument.create();

const report1Bytes = await fetch('report1.pdf').then(res => res.arrayBuffer());
const report2Bytes = await fetch('report2.pdf').then(res => res.arrayBuffer());

const report1Doc = await PDFDocument.load(report1Bytes);
const report2Doc = await PDFDocument.load(report2Bytes);

const report1Pages = await mergedPdf.copyPages(report1Doc, report1Doc.getPageIndices());
report1Pages.forEach(page => mergedPdf.addPage(page));

const report2Pages = await mergedPdf.copyPages(report2Doc, report2Doc.getPageIndices());
report2Pages.forEach(page => mergedPdf.addPage(page));

const mergedPdfBytes = await mergedPdf.save();
// mergedPdfBytes contains the merged PDF data

When to Use Merge PDF

  • Developers need to combine multiple PDF reports or invoices into a single file for distribution or archival.
  • Designers want to merge separate PDF design drafts while preserving embedded fonts and annotations.
  • SEO specialists consolidate PDF assets such as whitepapers or case studies for easier indexing and sharing.
  • Students merge scanned lecture notes or research papers to create a cohesive study document.
  • Anyone looking to combine multiple PDFs locally without risking data exposure to third-party servers.

For splitting merged documents afterward, consider using Split PDF. To optimize file size of the merged PDF, try the Compress PDF tool.

Frequently Asked Questions

Does Merge PDF preserve annotations and embedded fonts?

Yes, Merge PDF preserves annotations such as comments or highlights and embedded fonts by copying pages using PDFDocument.copyPages(). This ensures the merged output maintains the original document's appearance and metadata.

What is the maximum file size or number of pages supported?

The tool can handle input files totaling approximately 500MB in size, limited by browser memory. There is no fixed page limit, but performance depends on available system resources and total input size.

Is my PDF data uploaded to a server during merging?

No, all processing occurs entirely in your browser using client-side JavaScript. Your files never leave your device, ensuring maximum privacy and data security.

Can I reorder PDFs before merging?

Yes, you can rearrange the order of uploaded PDF files before merging. The tool merges files sequentially based on your specified order.

Can I split a merged PDF back into individual files?

You can use the related Split PDF tool to divide merged documents into separate files by page ranges or individual pages.

Related Tools

More Conversions