Skip to main content
PPDF123

Rotate PDF Pages

Rotate PDF turns pages by 90, 180 or 270 degrees and saves a new file. It rotates all pages by default, or only the pages you list. The angle is absolute, not added to the page's current rotation.

Drag and drop files here, or click to choose

Accepts PDF · up to 500.0 MB per file · up to 20 files at once

You can also paste a file with Ctrl/Cmd+V, or from the clipboard menu.

Rotate PDF sets `/Rotate` on the pages you select, or on every page by default, to 90, 180, or 270 degrees. The value is absolute, not added to the current rotation. A page already stored as 90 that you send 90 again stays 90.

The implementation writes the page attribute with lopdf. It does not reprint pages as images and does not call qpdf. The `pageNumbers` field (default `all`) selects the pages to turn. It accepts forms such as `1,3`, `2-5`, `all` and `2n+1`, and a page number that does not exist is rejected. Selected pages all get the same angle.

Viewers honor `/Rotate` when displaying. Some printers and importers ignore it. If a downstream tool still looks sideways, flatten or reprint is a different job.

Password-protected files are unlocked for you on this page once you enter the password; API callers run Unlock first. Angle values other than 90/180/270 are rejected.

Page selection is checked before anything is written. In a test on a 4-page PDF, `9` returned HTTP 400 with reason `page_out_of_range` and the detail "Page 9 does not exist; the document has 4 pages." A value like `abc` returned 400 with `invalid_page_selection` and the hint to use forms like `1,3,5-8` or `all`. An empty pages field turns every page, the same as `all`.

The same test showed that the angle is a stored value, not a delta. `2` with angle 90 wrote `/Rotate 90` on page 2 only. Sending that result back with angle 90 and pages `2` left page 2 at 90. On the 4-page file, `2n+1` with 270 wrote `/Rotate 270` on a single page, so check the result when you use an expression instead of a plain list.

The angle field is required by the server. The website form always sends one (default 90), but an API request without it fails with 400 and the detail "angle is required", and 45 fails with "Invalid angle. Please choose between 90, 180 and 270 degrees". There is no 0 option, so this tool cannot set a page back to its unrotated state. Keep the original upload, and if a rotation turns out wrong, rerun from the original with a different angle.

Choosing the angle: open the file in a viewer first and see how the page looks now. If a page needs a quarter turn, try 90 and look at the result; if it went the wrong way, rerun from the original with 270. An upside-down page needs 180. If only some pages are wrong, enter just those page numbers; if they need different angles, run the tool once per angle, each time on the previous result.

Rotate changes how a page is displayed. It does not change the page's text or images, and it does not straighten a scan that is a few degrees off. For that kind of skew, fix the source scan, because this tool only offers quarter turns.

Features

  • Page list is validated up front: unknown pages and malformed lists return 400 with a specific reason
  • An empty pages field behaves like `all`
  • Input must be a PDF; a non-PDF upload returns 400 with `invalid_pdf`
  • Sets `/Rotate` to 90, 180, or 270 on all pages or on a page list
  • Absolute angle, not incremental
  • Native lopdf; no rasterization
  • Anonymous API at /api/v1/general/rotate-pdf

When to use this tool

  • Turn a sideways scan export so viewers show it upright
  • Set every page to 180 after a head-down ADF pass
  • Normalize a mix of stored rotations to one angle
  • Fix the single sideways page that Images to PDF produced from a portrait phone photo
  • Turn only the landscape appendix pages of a report by listing their numbers, such as 12-15

How do I rotate pages in a PDF?

  1. Upload the PDF with pages that are stored sideways, upside down, or at an angle.
  2. Leave the pages field on all, or enter the pages to turn, then choose 90, 180, or 270.
  3. Click Process and download the PDF.
  4. Open it in a viewer that honors `/Rotate` and check a middle page.
  5. If a page came out wrong, rerun from your original file with another angle. The angle you send replaces the stored one, so rerunning on the result also works, but it can never return a page to 0.
  6. If you get a page-range error, compare the number in the message with your document's page count and correct the list.

Limits and edge cases

  • One angle per run: pages that need different angles take separate runs
  • Not incremental; not 0 or arbitrary degrees
  • Does not rasterize, so some printers ignore the flag
  • Page numbers beyond the document's page count fail the whole request with 400 rather than being skipped
  • Only quarter turns: no straightening of slightly skewed scans
  • Does not reorder, crop or resize pages; use Rearrange or Crop for those jobs
  • Upload limit on this website: 500 MB per file, sent in chunks above about 95 MB. A single direct API request body is capped at 100 MB.

Examples

  • A 3-page PDF with angle 90 gets /Rotate 90 on all three pages
  • Sending 90 to a file already at 90 leaves it at 90
  • Pages `2` with angle 90 on a 4-page A4 file puts `/Rotate 90` on page 2 only; pages 1, 3 and 4 are untouched
  • Leaving the pages field empty with angle 180 writes `/Rotate 180` on all four pages
  • Pages `9` on that same 4-page file returns 400 `page_out_of_range`, and no PDF is produced

Privacy for this tool

Files are uploaded over HTTPS, processed in memory or a short-lived temporary directory on our servers, and deleted when your result is ready. We do not keep copies for later browsing, training, or advertising profiles. See the Privacy Policy for retention details and AdSense cookie disclosures.

Frequently asked questions

How do I turn one portrait page into a landscape page?
Enter its page number and 90 (or 270). The page keeps its content and gets a rotation flag, so it displays as landscape. In our test, rotating page 2 of a 10-page file by 90 set that page only, and running the same rotation again left it at 90 instead of adding up.
Can I rotate only page 2?
Yes. Enter 2 in the pages field and only that page gets the new /Rotate value.
If I rotate 90 twice, do I get 180?
No. Each run writes the selected angle. Choose 180 if you want 180.
Does this redraw the page content?
No. It sets a page dictionary flag. Content streams stay as they were.
Why does a printer still output landscape?
Some print paths ignore /Rotate. That is a consumer issue, not a second rotation pass.
How do I undo a rotation I got wrong?
Go back to your original file and run Rotate again with another angle. The value is stored, not added, so a second run replaces the first. The tool offers no 0 option, which means a rotated page cannot be returned to its unrotated state from the result file.
Should I use 90 or 270 for a sideways page?
Try 90 on one page and look at it in your viewer. If it turned the wrong way, rerun from the original with 270. A quick check on one page costs less than guessing for a long file.
Why does Rotate say a page does not exist?
A listed page number is larger than the page count. The error reads like "Page 9 does not exist; the document has 4 pages." Page counts start at 1, and nothing is rotated when the request fails.
Can I rotate a scan by a few degrees to straighten it?
No. Only 90, 180 and 270 are accepted, and 45 is rejected with "Invalid angle". Small skew has to be corrected in the scanning software or by rescanning.
I rotated photos that were converted to PDF. Is that the right order?
Yes. Images to PDF does not read the photo's orientation tag, so a portrait phone photo can land on a landscape page. Rotate that page by 90 afterwards; no re-encoding of the picture is needed.

Last updated:

Call this from code

Every tool on this site is a plain REST endpoint - no account or API key needed for anonymous use. Built for AI agents and developers as much as for browsers.

curl -X POST "https://pdf123.xyz/api/v1/general/rotate-pdf" \
  -F "[email protected]" \
  -F "pageNumbers=all" \
  -F "angle=90" \
  -o output.pdf

Also available as an MCP tool for agent clients that speak Model Context Protocol (JSON-RPC 2.0 over POST /mcp). Full API reference

Use it from an AI agent

Skill

Claude Code, Codex, Cursor and other AI agents can run Rotate PDF for you with this skill: /skills/pdf123-rotate.md

All agent skills

Files are used only for this processing job and deleted automatically afterward.