Rotate PDF
Rotate PDF pages by 90, 180, or 270 degrees. Apply to all pages or select specific pages.
Rotate PDF
Change the orientation of specific or all pages. Click pages to cycle rotation, or use the controls to set a target angle.
Drop a PDF file here
or click to browse
How to Fix Sideways and Upside-Down PDF Pages
A 20-page scanned legal filing has 5 pages sideways (90 degrees) and 3 pages upside-down (180 degrees). Click each wrong page to cycle its rotation: 0, 90, 180, 270. The yellow badge shows the current angle. Or use the bulk button to set all pages to 0 degrees at once. The thumbnails update to show the corrected orientation before you download.
The rotate tool renders every page as a thumbnail. Click to cycle rotation (0, 90, 180, 270 degrees). Rotated pages show a yellow badge with the angle. Bulk buttons set all pages to a target angle simultaneously. The rotation is metadata-only: pdf-lib changes the /Rotate entry in the page dictionary without re-rendering the content, preserving perfect quality.
Common rotation problems and how to fix them
A 30-page document scanned with an auto-feed scanner has pages 1-10 correct, pages 11-15 rotated 90 degrees (fed sideways), and pages 16-20 rotated 180 degrees (fed upside-down). Click pages 11-15 three times each (to 270 degrees) and pages 16-20 twice each (to 180 degrees). Or use Reset to set everything to 0 and fix individually.
A 10-page contract photographed with a phone has alternating orientations: pages 1, 3, 5 are portrait; pages 2, 4, 6 are landscape; page 7 is upside-down. Click each page to cycle to the correct angle. The yellow badge shows the current rotation so you can track which pages still need adjustment.
A 50-page portrait report has 8 pages of landscape spreadsheets. Select those 8 pages and set them to 90 degrees. The bulk button "Set All 90" rotates everything, which is wrong for the portrait pages. Instead, click each landscape page individually to 90 degrees while leaving portrait pages at 0.
Related tools
How the PDF Rotate Tool Changes Orientation Without Re-Rendering
PDF pages have a /Rotate entry in their page dictionary that specifies the clockwise rotation angle (0, 90, 180, or 270 degrees). When a PDF viewer displays the page, it rotates the content by this angle. The rotate tool changes only this metadata entry: it does not re-render, re-encode, or recompress the page content. This means rotation is instant and lossless.
Why metadata-only rotation preserves perfect quality
The page content stream (text, images, vectors) is stored as-is. The /Rotate entry tells the viewer how to display it. Changing /Rotate from 0 to 90 does not modify any pixels or vectors. The viewer simply rotates the display. This is why the rotate tool can change orientation without any quality loss: it only modifies a single integer value in the page dictionary.
Click-to-cycle and bulk rotation
Clicking a page cycles its target rotation: 0, 90, 180, 270, then back to 0. The thumbnail re-renders to show the visual effect. Bulk buttons set all pages to a specific angle: "Set All 0" resets everything, "Set All 90" rotates all pages 90 degrees clockwise. The rotation state is tracked in an array that maps each page index to its target angle.
When you click Download, pdf-lib loads the source document, copies all pages, and applies setRotation() to each page with the target angle. The resulting PDF downloads with all rotations applied. The file size is essentially unchanged because only metadata was modified.
Frequently Asked Questions
Does rotating change the page content?
No. Rotation changes only the /Rotate metadata entry. The content stream (text, images, vectors) is untouched. The PDF viewer displays the content at the rotated angle. The file size is essentially unchanged. Quality is perfectly preserved because nothing is re-rendered or re-encoded.
What angles can I rotate to?
The PDF specification supports four angles: 0, 90, 180, and 270 degrees. These are the only values that PDF viewers recognize. The tool cycles through these four values when you click a page. Intermediate angles like 45 degrees are not supported by the PDF format.
Can I rotate just one page in a 50-page document?
Yes. Click that specific page to cycle its rotation. The other 49 pages remain at their current angle. The bulk buttons affect all pages, so use individual clicks when you only need to fix one or two pages. The yellow badge shows which pages are rotated.
Does rotation change the page size?
No. A letter-size page (612x792 points) remains 612x792 points regardless of rotation. The viewer rotates the display, not the page dimensions. If you need to actually swap width and height (portrait to landscape), you need a different tool that modifies the page media box.
What if a page is already rotated?
The tool adds 90 degrees to the current rotation when you click. If a page is already at 90 and you click it, it becomes 180. The bulk buttons set all pages to the exact angle regardless of their current rotation. Use Reset (set all to 0) to clear all existing rotations.
Can I rotate a scanned PDF?
Yes. Scanned PDFs are regular PDFs with image content. The rotation tool handles them identically: metadata changes, no re-rendering. A 30-page scanned document with mixed orientations can be corrected page by page. The thumbnails show the current orientation so you can verify which pages need fixing.