Rotate PDF Pages
Fix sideways or upside-down scans β rotate any page or the whole document, then download the corrected PDF.
Why PDF Pages End Up Sideways (And How to Fix Them for Good)
You've been there. A client sends over a scanned contract, you open it, and page three is rotated 90 degrees β readable only if you tilt your head like a confused dog. Or you've got a batch of invoices where someone fed the paper into the scanner the wrong way, so half the document is upside down. It's one of those annoyances that feels trivial but genuinely wastes time, especially when you're dealing with multi-page documents.
The good news is that rotating PDF pages is a well-understood operation, and you don't need Adobe Acrobat or any other paid software to do it correctly.
What Actually Causes Pages to Come Out Sideways
The most common culprit is a flatbed or sheet-fed scanner where the paper was placed horizontally rather than vertically. Many older office scanners default to landscape orientation, so if someone just drops a stack of A4 sheets in the feeder and walks away, the resulting PDF has every page rotated 90 degrees. The content is all there β it's just been captured from the wrong angle.
Photographs scanned from books cause a different kind of problem. When you scan a double-page spread and then split it into individual pages, the software sometimes loses track of orientation metadata, leaving you with pages that are 180 degrees off β right-side-up content that's somehow been flipped so it reads from the bottom up.
A third scenario involves PDFs generated from CAD or architectural drawing software. Engineering drawings are often created in landscape format, but when they're embedded into a report-style PDF, the page orientation either doesn't carry over properly or gets mixed with portrait pages β giving you a document where some pages require rotating your screen and others don't.
How PDF Rotation Actually Works Under the Hood
PDF files store rotation using an integer entry called /Rotate in each page's dictionary object. This value can be 0, 90, 180, or 270 β representing clockwise rotation in degrees. Crucially, it's stored separately from the actual content stream, which means rotating a page doesn't re-render or re-encode any images or text. It's purely a display instruction that tells viewers which way up to present the content.
This is why PDF rotation is both fast and lossless. You're not re-compressing JPEGs or recalculating vector paths. You're just changing a single number in the page descriptor. A 200-page scanned document with embedded high-resolution images rotates in milliseconds β and the images come out bit-for-bit identical to what went in.
If a page has no /Rotate entry, readers treat it as 0 degrees (the default). Some PDF generators skip the entry entirely for unrotated pages, which is why you'll occasionally see PDFs where certain pages appear to be missing rotation data β they're actually correct already; the absence of the entry means "display normally."
90 vs 270 Degrees: Clockwise vs Counter-Clockwise
This trips people up because the naming convention isn't always consistent across software. In the PDF specification, /Rotate 90 means the page content is rotated 90 degrees counter-clockwise from its natural orientation. So if your page appears lying on its left side (text running upward on screen), you need to rotate 90 degrees clockwise to correct it β which in PDF terms means adding 270 degrees, or equivalently subtracting 90.
Practically speaking: if text is running upward along the left edge of your screen, choose 90Β° clockwise. If text is running downward along the right edge, choose 90Β° counter-clockwise. If everything is upside down, 180Β° is your answer in either case.
When you apply multiple rotations to a page that already has a /Rotate value, they add together modulo 360. A page that's already at 90 degrees, rotated another 90 degrees clockwise, ends up at 180 degrees. The math is simple circular arithmetic β the kind where going past 360 wraps you back to zero.
Rotating One Page vs. the Whole Document
Sometimes you want to fix just a single offending page in an otherwise correctly-oriented document. Maybe it's a landscape-format table that got embedded incorrectly, or a signature page that someone scanned upside down. Rotating the entire PDF would ruin the rest of the document.
Per-page rotation works on exactly the same principle β you're just applying the /Rotate change to one specific page object rather than iterating through all of them. The rest of the document remains completely untouched.
For a document where every-other page is sideways (common with certain automatic document feeders that flip alternating sheets), you'd need to apply the rotation selectively page by page. If you find yourself with large batches like this regularly, it's worth looking at your scanner's duplex settings β most modern sheet-fed scanners have an option to automatically detect orientation based on content.
What to Do When Standard Rotation Doesn't Work
Encrypted or password-protected PDFs can't have their page structure modified without the owner password. If you try to rotate a protected PDF and get an error, the document has permissions restrictions that prevent editing. You'd need the owner password to unlock it first.
Very old PDFs (1.0 through 1.2 era) occasionally used different structures that modern tools handle slightly differently. If a rotated page still appears wrong after saving, try opening the output file in a different PDF viewer β sometimes it's a rendering quirk in the viewer rather than an actual problem with the file.
PDFs compressed using cross-reference streams (the default in PDF 1.5 and later when made by certain tools like some versions of Ghostscript or LibreOffice) store their object index in binary-compressed format rather than the traditional plain-text xref table. A tool that doesn't handle cross-reference streams will appear to see no pages in these files. In that case, "printing" the PDF to a PDF printer (or running it through Ghostscript with -sPAPERSIZE=a4 -dNOPAUSE -dBATCH -sDEVICE=pdfwrite) will normalize it to a traditional structure that any PDF tool can handle.
Preserving Quality Through the Rotation Process
One thing worth repeating: properly implemented PDF rotation is completely lossless. The pixels in your scanned images don't change at all. The /Rotate flag is pure metadata β the image data itself sits in compressed stream objects that are copied through exactly as-is. This is fundamentally different from rotating an image in photo editing software, where re-saving at an angle involves a new interpolation pass that can soften edges or introduce compression artifacts.
So if you've got a 300 DPI scan of an important document, rotating and re-saving it this way will give you output that's identical in quality to the input. The only thing that changes is which way the reader holds the digital page.
A Practical Tip for Batch Scanning Going Forward
If you're scanning documents regularly and finding yourself having to fix rotation afterward, the fastest long-term fix is to configure your scanner software to use automatic orientation detection (sometimes called "auto-rotate" or "text orientation detection"). Modern scanner drivers do this by detecting which direction text baselines run. It's not perfect on documents with mixed orientations β like a report that includes landscape charts β but it eliminates about 90% of the manual correction work.
For the remaining cases, having a reliable in-browser rotation tool means you can fix files without installing anything, sharing documents with a third-party service, or paying for software you'll use three times a year. The operation is simple enough that it should just work, quickly, on whatever computer you happen to be sitting at.