Merge Multiple PDFs into One Document
Combine any number of PDF files into a single, perfectly ordered document via REST API. Preserve bookmarks, page layouts, and formatting. Perfect for generating reports, contracts, and compiled documents.
# Merge multiple PDF files into one
curl -X POST \
https://api.convertfilefast.com/v2/pdf/merge \
-H "Authorization: Bearer YOUR_API_KEY" \
-F "files=@document1.pdf" \
-F "files=@document2.pdf" \
-F "files=@document3.pdf" \
--output merged.pdf
# HTTP 200 OK — Content-Type: application/pdfimport requests
files_to_merge = ["document1.pdf", "document2.pdf", "document3.pdf"]
files = [("files", open(f, "rb")) for f in files_to_merge]
response = requests.post(
"https://api.convertfilefast.com/v2/pdf/merge",
headers={"Authorization": "Bearer YOUR_API_KEY"},
files=files
)
with open("merged.pdf", "wb") as f:
f.write(response.content)const formData = new FormData();
// Loop through array of files to merge
const filesToMerge = ["document1.pdf", "document2.pdf", "document3.pdf"];
filesToMerge.forEach((fileName) => {
formData.append("files", fs.createReadStream(fileName));
});
const response = await fetch(
"https://api.convertfilefast.com/v2/pdf/merge",
{
method: "POST",
headers: { "Authorization": "Bearer YOUR_API_KEY" },
body: formData,
}
);
fs.writeFileSync("merged.pdf", Buffer.from(await response.arrayBuffer()));// n8n HTTP Request Node
{
"method": "POST",
"url": "https://api.convertfilefast.com/v2/pdf/merge",
"contentType": "multipart-form-data",
"bodyParameters": {
"parameters": [
{ "name": "files", "parameterType": "formBinaryData", "inputDataFieldName": "data" }
]
},
"options": { "response": { "responseFormat": "file" } }
}Advantages
Why use our API?
Complete and reliable solution for integration in any tech stack.
Unlimited Files
Merge two or dozens of PDF files in a single API request. No limit on the number of input files.
Preserve Order
Files are merged in the exact order you send them. Control the final document structure precisely.
Bookmark Support
Bookmarks and internal links from source PDFs are preserved and merged into the output document.
Fast Processing
Merge large multi-file documents in seconds. Infrastructure optimized for high-throughput operations.
Automation Ready
Integrate into document workflows with n8n, cron jobs, or custom pipelines. Batch merging supported.
Zero Storage
All uploaded PDFs are processed in memory and deleted immediately after merging. No permanent storage.
Or call this from Claude, Cursor, or any MCP client
Convert File Fast ships a native Model Context Protocol server. Give this conversion to an AI agent as a single tool call — no HTTP client, no binary handling, per-user API keys.
npx -y convertfilefast-mcpmerge_pdfs({ source_urls: ["https://example.com/a.pdf", "https://example.com/b.pdf"] })FAQ
Frequently Asked Questions
How many PDF files can I merge in a single request?
There is no limit on the number of input files. Repeat the `files` form field once per document — `-F "files=@a.pdf" -F "files=@b.pdf"` — and every file you attach becomes part of the same output PDF.
In what order are the documents combined?
Files are merged in the exact order you send them in the request. The first `files` field becomes the first pages of the output, the second follows it, and so on, so you control the final document structure precisely.
Are bookmarks and internal links preserved?
Yes. Bookmarks and internal links from each source PDF are carried into the merged document and remapped to their new page positions, so tables of contents in compiled reports and contracts keep working.
What is the maximum file size supported?
Limits depend on your plan and are enforced per API key — the API reports the ceiling it currently accepts at https://api.convertfilefast.com/v1/info, and your own plan limit is shown in your dashboard. If a file exceeds it, compress it first with the Compress PDF endpoint.
Related Tools
Start Merging PDFs via API
Get your API key and merge your first PDF documents in seconds. Free plan includes 10 conversions per month.
No credit card. 10 free conversions on Free plan.