Merge PDF – Frequently Asked Questions

Everything you need to know about combining multiple PDF files online with PDF Lab's free merger

← Go to Merge PDF Tool

The Merge PDF tool is a free online service that allows you to combine multiple PDF files into a single, unified document.

Key Features:

  • Multiple File Upload: Upload 2 or more PDF files simultaneously
  • Drag-and-Drop Reordering: Rearrange PDFs visually before merging using SortableJS
  • Page Selection: Choose specific pages from each PDF to include
  • Quality Preservation: Original formatting, fonts, and images remain intact
  • Fast Processing: Server-side merging with FPDI for efficient page importing

Technical Implementation: The tool uses FPDI (Freelance PDF Importer) to import pages from multiple source PDFs at the vector level. Each page is imported with setSourceFile() and importPage(), then added to a new PDF document while preserving all original properties including dimensions, fonts, and embedded resources.

The Merge PDF tool supports merging multiple PDF files in a single operation with no strict limit.

Upload Capabilities:

  • HTML5 Multiple Input: The file input uses multiple attribute for simultaneous uploads
  • Practical Limits: Depends on browser memory and total file size
  • Recommended: 2-20 PDFs at once for optimal performance
  • Large Batches: For 50+ PDFs, consider splitting into multiple merge operations

Performance Considerations:

  • Each PDF is processed sequentially on the server
  • Total processing time increases with file count and size
  • Browser upload limits may apply (typically 2GB per request)

Yes! The Merge PDF tool features intuitive drag-and-drop reordering.

How to Reorder PDFs:

  1. Upload your PDF files using the file picker
  2. Each PDF appears as a card showing filename and page count
  3. Click and hold on any PDF card
  4. Drag the card to its desired position
  5. Drop it in place – other cards automatically shift
  6. Repeat for any PDFs you want to reposition

Technical Details:

  • SortableJS Library: Powers the drag-and-drop functionality
  • Visual Feedback: Cards highlight and show ghost images during dragging
  • Client-Side Only: Reordering happens in the browser before server processing
  • Touch Support: Works with touch gestures on mobile devices

The final merge order is exactly as you arrange the cards on screen from top to bottom.

Absolutely! You have complete control over which pages from each PDF are included in the merge.

How Page Selection Works:

  1. After uploading PDFs, each card displays a "Pages" input field
  2. Leave blank to include all pages from that PDF
  3. Enter specific page numbers or ranges to include only those pages
  4. Examples:
    • 1-5 → Pages 1 through 5
    • 1,3,5 → Only pages 1, 3, and 5
    • 1-3,7,10-12 → Pages 1-3, page 7, and pages 10-12

Page Selection Features:

  • Flexible Syntax: Supports comma-separated pages and dash-separated ranges
  • Custom Order: Pages are included in the order you specify (e.g., 5,3,1)
  • Validation: Server validates page numbers against actual PDF page count
  • Error Handling: Invalid page numbers are skipped automatically

The page selection syntax is designed to be flexible and intuitive.

Syntax Rules:

  • Single Pages: Enter numbers separated by commas
    • Example: 1,5,9 selects pages 1, 5, and 9
  • Page Ranges: Use hyphens for consecutive pages
    • Example: 1-10 selects pages 1 through 10
  • Mixed Syntax: Combine single pages and ranges
    • Example: 1-3,7,10-15,20 selects pages 1-3, 7, 10-15, and 20
  • Custom Order: Pages appear in the order you list them
    • Example: 10,5,1 places page 10 first, then 5, then 1

Server-Side Processing:

  • PHP parses the input using regex and explode functions
  • Ranges are expanded (e.g., 1-3 becomes [1,2,3])
  • Each page number is validated against the source PDF's page count
  • Invalid or out-of-range pages are silently skipped
  • Duplicate page numbers result in that page being included multiple times

Pages are merged exactly in the order you specify, both for PDF files and for pages within each file.

Merge Order Logic:

  1. PDF File Order: PDFs are processed in the order you arrange them with drag-and-drop (top to bottom)
  2. Page Order Within Each PDF: Pages are extracted in the order specified in the "Pages" field
  3. Final Result: All selected pages from PDF #1, then all selected pages from PDF #2, and so on

Example:

  • PDF A (pages: 5,3,1) → Contributes pages 5, 3, 1 in that order
  • PDF B (pages: 1-3) → Contributes pages 1, 2, 3
  • Merged Result: Pages A5, A3, A1, B1, B2, B3

This gives you complete control to create custom arrangements, such as interleaving pages from different documents or creating specialized compilations.

Yes, 100%! The Merge PDF tool preserves all original formatting and quality.

What's Preserved:

  • Vector Graphics: All vector content remains resolution-independent
  • Fonts: Embedded fonts are imported and remain embedded
  • Images: Photos and graphics maintain original resolution and compression
  • Colors: Color profiles and color spaces are preserved
  • Page Dimensions: Each page keeps its original size (A4, Letter, custom sizes)
  • Hyperlinks: Internal and external links remain functional
  • Form Fields: Interactive PDF forms are preserved
  • Metadata: Document properties can be inherited or set

Technical Implementation:

  • FPDI Import: Pages are imported at the vector level using setSourceFile() and importPage()
  • No Re-rendering: Original page content is directly embedded, not re-rendered
  • Template Usage: FPDI uses imported pages as templates with useTemplate()
  • Coordinate Preservation: Page sizes and coordinate systems are maintained

The output is a standard PDF file compatible with all PDF readers.

Output File Details:

  • Filename: merged_[timestamp].pdf
    • Example: merged_20250116_143052.pdf
  • PDF Version: PDF 1.7 (or higher if source PDFs require it)
  • Compatibility: Works with Adobe Acrobat, browser PDF viewers, mobile PDF apps
  • File Size: Sum of selected pages from all source PDFs (no additional compression)

File Storage:

  • Merged PDF is created in the /tmp folder
  • Automatically downloaded to your device
  • Temporary files are cleaned up after session ends
  • Not stored permanently on the server

No, password-protected PDFs cannot be merged directly without removing the password first.

Why Not?

  • Security Measure: Password protection prevents unauthorized modification
  • FPDI Limitation: The FPDI library cannot import pages from encrypted PDFs
  • Authorization Required: You must have the password to prove ownership

Solution:

  1. Use our Unlock PDF tool first
  2. Enter the password to remove protection
  3. Download the unlocked PDF
  4. Use the unlocked file in the Merge PDF tool

Alternative: If you have the password, you can also use Adobe Acrobat or another PDF tool to save an unprotected copy before merging.

Yes! The Merge PDF tool is fully responsive and works on smartphones and tablets.

Mobile Features:

  • Touch Gestures: Drag-and-drop reordering works with touch (tap, hold, drag, release)
  • File Upload: Access your device's file picker to select PDFs
  • Page Selection: Text input fields work with mobile keyboards
  • Responsive Layout: Cards stack vertically for easy viewing on small screens

Mobile Tips:

  • Use landscape orientation for more screen space when reordering
  • Tap and hold for 0.5 seconds to initiate drag-and-drop
  • For large merges with many files, desktop provides easier management
  • Ensure stable internet connection for large file uploads

No, we do not permanently store your PDF files. Your privacy is our priority.

File Handling Process:

  • Temporary Upload: Uploaded PDFs are stored in /tmp folder during processing
  • Session Isolation: Each user's files are isolated with unique session identifiers
  • Processing Only: Files are accessed only to perform the merge operation
  • Automatic Cleanup: All temporary files (uploads and output) are deleted after download
  • No Database Storage: Files are never saved to any database
  • No Third-Party Access: Files are not shared with any external services

Security Measures:

  • HTTPS encryption for all uploads and downloads
  • File path validation to prevent unauthorized access
  • Server-side processing without file content inspection

The Merge PDF tool uses industry-standard libraries and modern web technologies.

Backend Technologies:

  • FPDI (Freelance PDF Importer): PHP library for importing existing PDF pages
    • setSourceFile() – Opens source PDFs
    • importPage($pageNumber) – Imports individual pages
    • useTemplate($templateId) – Places imported pages in new PDF
  • TCPDF: PDF generation and manipulation library (works with FPDI)
  • PHP 7.4+: Server-side processing, file handling, and page selection parsing

Frontend Technologies:

  • SortableJS: Drag-and-drop reordering library with touch support
  • HTML5 Multiple File Input: <input type="file" multiple> for simultaneous uploads
  • JavaScript (ES6+): File preview, validation, and UI interactions
  • CSS3: Responsive card layout and drag visual feedback

Processing Workflow:

  1. Client uploads files and specifies order/pages
  2. Server receives files and page selection data
  3. PHP parses page syntax and validates numbers
  4. FPDI imports specified pages from each PDF sequentially
  5. Pages are added to new PDF in specified order
  6. Final merged PDF is generated and returned for download