How to rotate PDF pages
- Drop your PDF into the zone above, or click to browse.
- Choose the rotation amount — 90° Left (counter-clockwise), 180° (upside down to right-side up), or 90° Right (clockwise).
- Choose which pages to rotate: All pages applies the rotation to the whole document. Specific pages lets you enter a range like
1, 3, 5-8to target individual pages only. - Click Rotate & download. The corrected PDF saves directly to your device.
Everything runs in your browser using pdf-lib.
No file is sent to a server — open DevTools (F12) → Network while rotating to verify zero upload requests.
When to rotate a PDF
- Fixing a sideways scan — a flatbed scanner or phone camera scan of a landscape document often produces a portrait PDF with the content rotated 90°. One click corrects it permanently.
- Correcting a PDF created from a mobile photo — phones sometimes mismatch EXIF orientation metadata with the image data, producing an upside-down or sideways PDF.
- Rotating a single inserted page — you merge a landscape chart into a portrait report; the chart page needs to be rotated 90° to match the reading direction.
- Fixing a scanned signature page — someone scanned a signed page upside down before returning it. Rotate 180° and it is ready to archive.
- Correcting a batch of invoices — a multi-page scan came back entirely sideways; rotating all pages at once saves editing each individually.
How it works under the hood
PDF pages store a rotation value as part of their metadata — it can be 0°, 90°, 180°, or 270°. This value tells PDF viewers and printers how to orient the page when displaying it. The actual page content (text, images, vector graphics) is stored in its original orientation and rendered with a coordinate transform applied.
pdf-lib reads the current rotation value for each targeted page using page.getRotation().angle, adds the chosen rotation amount, and writes the new value with page.setRotation(degrees(...)). The operation modifies only this metadata field — content bytes are untouched, which means text stays selectable, images stay at full resolution, and file size barely changes.
Because the rotation is cumulative (added to the existing value), a page already rotated 90° that receives another 90° rotation ends up at 180°. If you need to reset a page's rotation entirely, rotate it by whatever angle brings the total back to 0°.
Limits and what to expect
- Rotation increments: PDF only supports multiples of 90°. Arbitrary angles (like 45°) are not possible in standard PDF — that would require re-rendering the content, which this tool does not do.
- Existing rotations are cumulative: if a page already has a 90° rotation stored, adding 90° right will bring it to 180°. Add 270° (90° left) to counteract an existing 90° right rotation.
- Password-protected PDFs: the tool attempts to load encrypted PDFs with the
ignoreEncryptionflag. PDFs that require a password to view their content will fail — unlock them first. - File size: rotation changes only PDF metadata, so the output file is virtually identical in size to the input.
- Browser support: Chrome 90+, Firefox 90+, Safari 15+, Edge 90+.
Privacy: what happens to your file
Your PDF is read into browser memory and rotated locally. Nothing is sent to a server. The corrected file is assembled in memory and downloaded directly to your device — the data is local from start to finish.
For sensitive documents — medical records, legal filings, financial statements — this architecture means there is no third-party server to trust or track. Open the Network tab in DevTools while rotating to see zero outbound file transfers.