Organize PDF
Published Updated
Type the page order you want, such as 3, 1, 2, 2, and download a PDF with the pages arranged that way.
Typed lists and what they make
Take a 6-page PDF. The box accepts whole numbers from 1 to 6, separated by commas.
| You type | You get |
|---|---|
| 6, 1, 2, 3, 4, 5 | Last page moved to the front, 6 pages |
| 1, 2, 3, 3, 4, 5, 6 | Page 3 twice, 7 pages |
| 1, 3, 5 | Three odd pages only, 3 pages |
| 2, 1, 4, 3, 6, 5 | Each pair swapped, 6 pages |
| 1-3 | Message: Couldn't understand "1-3" |
| 7 | Message: Page numbers must be between 1 and 6 |
What is copied into the new file
The pages are copied with pdf-lib into a new, empty document, so page content, fonts and images come along and stay sharp. What does not come along lives at the document level: the title and author, and the bookmark outline. In our test the output reported no title or author, and a PDF with a bookmark in the source had no outline in the result.
Pages that reuse the same fonts or images share one copy inside the file. The PDF 32000-1 specification defines the page tree separately from document-level data such as the info dictionary and the outline, which is why one can be copied without the other.
What the output keeps and loses: a test on generated PDFs
We ran the page's own reorder steps (the page-isolation function from lib/pdfPagePrune.ts, then pdf-lib 1.17.1 copyPages, the link and form steps from lib/pdfOrganizeCopy.ts, and save) in Node 22.23.1 on PDFs we built with pdf-lib, and read the results with pdf.js 5.4.624 and pdf-lib. Each page holds the text PAGE and its number; in the size test every page also holds a different 300 x 200 noise picture.
| Test | Result |
|---|---|
| Typed list 12, 11, 10 and so on down to 1 on a 12-page file | The text on the pages read PAGE 12 first and PAGE 1 last. |
| Typed list 3, 1, 2, 2, 12 | Five pages: PAGE 3, PAGE 1, PAGE 2, PAGE 2, PAGE 12. |
| Letter, A4 and a 400 x 300 page rotated 90 degrees with a crop box, listed as 3, 2, 1 | Same sizes, same rotation and same crop box on each page, in the new order. |
| A text field on page 2, listed as 2, 1 or as 1, 3 | A text box and a check box on page 2 stayed form fields in the 2, 1 result: pdf-lib listed both, pdf.js listed both field objects with their widgets on page 1, and the text box could be filled and saved again. With 1, 3 only the field that sits on page 3 was left, with its value. |
| A link on page 1 to page 4, listed as 1, 2, 3 (page 4 not kept) | The link was removed, and the other links were kept. |
| Links between pages of the same file, listed as 4, 3, 2, 1 and also as 1, 2, 3, 4 | Every destination was a page of the new file. In both orders pdf.js resolved each link to the page that holds its target, including a link made with a named destination and one made with a GoTo action. A web-address link stayed a web-address link. |
So an order list reorders the pages themselves, with their size, rotation and, judging by the file sizes, their pictures, and links between the kept pages and the form fields on them as well. Bookmarks are not copied. The link and form checks used small PDFs we built with pdf-lib and read back with pdf.js and pdf-lib, so a PDF from another program may behave differently.
The site's own Organize PDF component gave the same results in Google Chrome 156, Chromium 153 (Playwright build, not Google Chrome), Firefox 155 and Playwright's WebKit build (not the Safari app) on a generated 6-page PDF: the list 5, 1 kept the link from the old page 5 to the old page 1, now from page 1 to page 2, removed the link from page 1 to the left-out page 4, and kept the text field that appears on both pages, with its value.
| Page list (12-page file, 2,166,550 bytes) | Result size |
|---|---|
| All 12 pages, reversed | 2,166,510 bytes |
| The first 6 pages | 1,083,595 bytes |
| Page 1 once | 181,155 bytes |
| Page 1 six times | 181,217 bytes |
| All 12 pages twice (24 pages) | 2,166,638 bytes |
Leaving pages out removed their pictures from the file, so six pages weighed about half of twelve. A repeated page costs almost nothing, because the picture is stored once. Reversing 300 text pages took 46 ms in Node, in one run.
Comments, markup and layers on reordered pages
The new file is built with pdf-lib's copyPages, which copies pages from one document into another, and the comments and other annotations of a page travel with it. Measured in Google Chrome 157 with the site's own Organize PDF component on a generated 4-page file, page list 4, 2, 1 (page 3 left out); Firefox 155 and the WebKit build gave the same result:
| Source page | In the new file |
|---|---|
| Page 1: a sticky note by Reviewer A with its pop-up, and a reply by Reviewer B | Page 3: the note, its pop-up and the reply, with both names; the pop-up and the reply still point at the note |
| Page 2: a highlight, a free-text box, an ink drawing, an Approved stamp and an attached file | Page 2: all five, with the author names they carried and the attached file |
| Page 3, left out: a note and a square by Reviewer C | Not in the file: a search of every object, streams decompressed, found neither comment text nor the name Reviewer C |
| Page 4: a red square on a layer that is off by default | Page 1: the file has no layer list (OCProperties), and pdf.js drew the square (14,400 red pixels) |
| Page labels 11 to 14 | None: pdf.js reports no page labels |
Reordering pages in a PDF
Step 1
Add a PDF
Pick one PDF that is not password-protected. The page count is read and the box is filled with 1, 2, 3 and so on.
Step 2
Edit the order
Change the list to the order you want. Numbers can repeat, and numbers you leave out are dropped. Reset returns to the original.
Step 3
Reorganize and download
The new PDF is built from the listed pages and offered as a download.
Other page tools on this site
Reordering is one job, and these tools cover its neighbors:
- Remove pages by number: PDF Page Remover.
- Pull selected pages into a new file: Extract Pages from PDF.
- Turn pages: Rotate PDF. Combine files: PDF Merge. Split one file: PDF Split.
There is no thumbnail drag-and-drop here. You work from page numbers, so check a page before you rely on its position.
Questions about reordering pages
Can I type a range like 1-5?
No. Each entry must be a single whole number separated by commas, so 1-5 shows the message Couldn't understand "1-5". Write 1, 2, 3, 4, 5 instead.
How do I move the last page to the front?
In a 12-page file, replace the box contents with 12, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11. The page list is the order of the new file.
Does repeating a page make the file much larger?
Not much. In a test with a 3-page PDF holding a 270 KB picture on page 1, repeating that page five times gave a 271 KB file, because the image is stored once and shared.
Why are my bookmarks and document title gone?
The tool builds a new PDF and copies only the pages. Bookmarks, the title and author are not copied, and the producer field shows pdf-lib. Our check showed the outline missing from the output.
Can I use it to delete pages?
Yes, leave the page out of the list. If you only want to delete some pages, Page Remover is more direct, because it asks for the pages to remove.
Why does it refuse my PDF?
Password-protected PDFs are rejected with a message. Remove the password with Unlock PDF first, then reorder.
Do the links in my PDF still work after reordering?
Links between pages that are in the new file are rewritten to point at the page's new position, including links that used a named destination. A link to a page that was left out is removed, because it could not go anywhere. Links to web addresses are left as they are. In our test, pdf.js 5.4.624 resolved every internal link to the right page of the new file.
Are form fields kept?
Yes, for the fields that sit on pages you keep. The new file gets its own form entry that lists those fields, with the source form's default font resources and appearance settings. A text box and a check box on page 2 were read back as form fields by both pdf-lib and pdf.js after reordering, and the text box could be filled and saved again with pdf-lib. Fields on pages you leave out are dropped. XFA forms are not carried over.
Are page sizes and rotation kept?
Yes in our test: Letter, A4 and a rotated 400 x 300 page with a crop box all kept their size, rotation and crop box in the new order.
Are comments and highlights kept when I reorder pages?
Yes, on the pages you keep. A sticky note with its pop-up and a reply, a highlight, a free-text box, an ink drawing, a stamp and a file attachment all came through, with the author names they carried, and the reply still pointed at its note.
Do comments on a page I leave out stay hidden in the file?
No, they are not in the file at all. The text of a note and a square on the left-out page, and their author's name, were searched for in every object of the new file with the streams decompressed, and none of them was found.
Can content on a hidden layer become visible?
Yes. The new file does not get the source's list of layers, so a layer that was off by default loses that setting. A red square on such a layer was invisible in the source and was drawn by pdf.js on the reordered page in Chrome 157, Firefox 155 and the WebKit build.
Related guide
How to flatten, resize and shrink a PDF. The guide shows what a reordered copy keeps on a form test file: the link survives and the fillable fields do not.