PDF page ranges cheat sheet: the syntax every tool here understands

Several YantraStack PDF tools ask for pages. They all share one small syntax, so you only need to learn it once. Pages are numbered from 1, the way your PDF viewer shows them.

The rules

You typeYou get
5page 5
1,3,7pages 1, 3 and 7
2-6pages 2 through 6
8-page 8 to the last page
-3page 1 to page 3
lastthe final page
1-3, 9, 12-any combination, separated by commas
4-2pages 4, 3, 2 (a backwards range reverses the order)

Spaces are ignored. Duplicates are removed, and the order you type is kept, which is why Extract Pages with 3,1,2 also reorders pages.

Worked examples

Remove the cover and the last page from a 10-page file: use Remove Pages with 1,10, or 1,last.

Split a report into chapters that start on pages 1, 5 and 12 of a 20-page file: use Split PDF in custom ranges mode with 1-4, 5-11, 12-. Each comma-separated group becomes its own file.

Rotate only the landscape pages 7 to 9: use Rotate PDF with 7-9.

Number every page except the cover: use Add Page Numbers with 2- and set the start number to 0 if you want page 2 labelled “1”.

Common mistakes

  • Page numbers vs. printed numbers. If your document has a cover and roman-numeral front matter, “page 1” in a viewer is the very first sheet, not the first numbered one.
  • Ranges outside the document. Asking for page 40 in a 30-page file gives a clear error instead of silently ignoring it.
  • Using other separators. Commas and semicolons both work, but dots do not (1.3 is not valid).

All guides

↑ ↓ navigateEnter openEsc close