Alternate Mix PDF interleaves the pages of two local PDFs in a fixed A1, B1, A2, B2 reading order, then appends every remaining page from whichever document is longer, and the entire operation runs inside a single browser tab without uploading either file. The tool accepts two PDFs labeled A and B, each non-empty and no larger than 25 MiB, and produces one downloadable PDF whose page count equals the sum of both inputs. Each copied page keeps its own PDF page box, rotation, vector drawing, text, and embedded raster content to the extent the underlying library can copy them, so a landscape page from B stays landscape even when A is portrait. Pages are not resized, stretched, rasterized, or separated by blank inserts. The tool is built around one deterministic rule: A leads, B follows, A leads again, and so on until one document runs out; the longer document's tail is then appended in its own internal order. Because the first selectable file is always A, swapping the two selections shifts the whole sequence from A1, B1 to B1, A1, giving users explicit control over which stream leads. Open the tool at Alternate Mix PDF to start.

How the Alternating Sequence Works
The tool has a single fixed ordering rule, and the rule is the entire point of the workflow. The first selectable file is called A and always contributes page one of the output; the second selectable file is called B and contributes page two. From there, the sequence keeps alternating: A page 2, B page 2, A page 3, B page 3, and so on. Once the shorter document runs out of pages, every remaining page from the longer document is appended in its original internal order at the end of the new file. There is no guessing about front versus back, no automatic reverse, and no preference for the first selected document beyond supplying the first output page.
If a scanner produced one of the input stacks in reverse order, that stack needs to be reordered with a separate tool before it is mixed in. The page-by-page reference sequence is derived deterministically and applied once, which is why the resulting page count equals the sum of both inputs. Pages are copied as PDF pages through the existing library rather than converted to screenshots or flattened to images, a behavior documented at the pdf-lib copyPages reference for the PDFDocument class.
Mix Two PDFs in Alternating Order
Three short steps separate a pair of ready-to-mix PDFs from a single interleaved document. Before starting, decide which input should lead (it becomes A) and make sure both files are already in the internal order you want to preserve.
- Choose non-empty PDF A and PDF B, each no larger than 25 MiB.
- Confirm that both source files are already in the intended internal order.
- Select Alternate and mix PDFs, verify the A+B page total, and download the result.
Choosing a replacement for either input clears the old output, so the displayed page total always reflects the most recent selection pair. A job identifier prevents a slower earlier operation from replacing a result made from newer files. The new filename combines both cleaned source names and adds -alternated.pdf, while the original PDFs stay exactly where they were on your device. Because loading, copying, serialization, and download creation all happen inside the browser, you do not need to upload the documents to mix them.
Output Examples for Uneven Page Counts
The rule is the same in every row: the sequence alternates A and B until one input runs out, then the remaining pages from the longer document are appended in their original order.
| Pages in A | Pages in B | Output sequence | Total pages |
|---|---|---|---|
| 3 | 2 | A1, B1, A2, B2, A3 | 5 |
| 1 | 3 | A1, B1, B2, B3 | 4 |
| 4 | 4 | A1, B1, A2, B2, A3, B3, A4, B4 | 8 |
| 5 | 2 | A1, B1, A2, B2, A3, A4, A5 | 7 |
| 2 | 5 | A1, B1, A2, B2, B3, B4, B5 | 7 |
The numbers in the table come directly from the documented tool behavior. A three-page A document and a two-page B document produce A1, B1, A2, B2, A3 — five pages total, which equals the sum 3 + 2. A one-page A document and a three-page B document produce A1, B1, B2, B3 — four pages total, which equals 1 + 3. The longer input always controls how many tail pages follow the alternating run, and the result line on the tool reports the page count of each input plus the total output count.
When Alternating Page Order Is the Right Choice
This workflow fits a small set of specific situations where two page streams already have a natural pairing. One common case is joining front and back scan streams from a duplex scanner that saved the odd and even sides as two separate PDFs: the resulting file prints as a normal booklet when A contains the odd-numbered pages in order and B contains the even-numbered pages in order. Another case is alternating a question document with a matching answer document, or pairing translated pages with their originals, so a reader sees source and translation side by side without flipping between files.
The tool also suits combining two chronological page sets into a single chronological sweep, or merging odd and even batches that are already in the correct internal order. It does not merge all pages of A followed by all pages of B (use Merge PDF for simple concatenation), does not reverse a source, does not select ranges, and does not deduplicate or compare content. If the desired result is a printed folded booklet rather than an interleaved file, use Booklet PDF for imposition instead.
File Limits and Browser Memory Behavior
Each input must be a non-empty PDF no larger than 25 MiB. The 25 MiB limit applies separately to each input, not to their combined output, so a 24 MiB A and a 24 MiB B can still be mixed even though the resulting PDF is larger than 25 MiB. Encrypted, damaged, unsupported, oversized, or incorrectly labeled files produce a visible error rather than a silent failure. Password protection is not bypassed: if a file is locked, the password must be removed with a tool like Remove PDF Password before the file can be selected.
Because the entire operation runs in one browser tab, the practical memory cost can exceed the two source file sizes. Both documents and the newly serialized result may coexist temporarily while the tool is producing the download, which is why closing other heavy tabs helps on memory-constrained devices. The original files remain unchanged throughout, but irreplaceable originals should still be kept outside the browser workflow as a precaution.
What the Output Keeps and What May Change
The tool preserves the visible content of every page. Each copied page retains its own page-box dimensions, rotation, vector drawing, text, and embedded raster content to the extent supported by the library's copy operation. The tool does not force every page to the first document's size, does not stretch content, does not rasterize text, and does not insert blank separator pages between alternating sections. The first selectable file's page size therefore does not dictate the size of pages that came from the second document.
Interactive document behavior, however, may not survive page copying with the same semantics. Form fields, bookmarks, outline destinations, scripts, attachments, and cross-document links are advanced structures the tool does not promise to preserve. If any of those matter for a particular file — for example, a fillable form or a document with a navigation outline — inspect the resulting PDF after mixing and use a dedicated tool to restore the missing structure. For a deeper look at the underlying copy operation that backs this preservation behavior, the pdf-lib PDFDocument copyPages API documents how individual pages are copied into a fresh document.
Tools to Use Before or After Mixing
Two adjacent tools cover the most common pre- and post-processing needs. Reorder PDF Pages is the right tool to run before mixing whenever one of the source files is in the wrong order, since Alternate Mix PDF will not reverse it for you. Merge PDF is the right tool if the desired output is simply all of A followed by all of B without any alternation, which is a different task entirely. Booklet PDF handles imposition for a folded booklet.
A reader who wants a fuller walkthrough of the same procedure can follow the step-by-step guide to mixing two PDFs in alternating order. For an input that contains a sideways page, the Rotate PDF tool can fix the orientation before it is mixed in. None of these tools are required — the only inputs Alternate Mix PDF needs are two non-empty PDFs already in their intended order — but they cover the realistic situations where one of the inputs needs a small fix before it can participate in an alternating sequence.