Skip to main content
HerePDF

Guide

How to Fix a Sideways or Upside-Down Scanned PDF

By Happy Turtle Tech · Published · Updated

Part of the topic Prepare a PDF for an Online Submission

Scanned documents arrive rotated constantly. A page fed in landscape, a double-sided scan where every second sheet is upside down, a phone photo the camera decided was portrait. You rotate it in your reader, it looks right, you send it - and the recipient opens a sideways document. Or you reopen it yourself the next morning and the rotation has vanished.

This isn't a bug. It's two different things both called "rotate."

View rotation vs page rotation

View rotation turns what's on your screen. It's a property of the window you're looking through, not of the document, and most readers discard it the moment you close the file. In Adobe Acrobat it lives under the View menu; in macOS Preview and Chrome's built-in viewer the toolbar rotate buttons often behave this way. Nothing about the file changes, which is why nobody else sees your correction.

Page rotation changes the document. Every page in a PDF carries a rotation value - one of 0, 90, 180, or 270 degrees - that tells any viewer how far to turn that page before drawing it. Change that number and save, and the page is genuinely fixed for everyone who opens it afterwards.

The confusion is that both produce an identical result on screen. The only way to tell them apart is to save, close, and reopen - or better, to check whether the tool you used produced a new file at all. If nothing was saved, nothing was changed.

How rotation is actually stored

It's worth knowing what's happening underneath, because it explains why rotating is one of the safest things you can do to a PDF.

Each page object holds an entry - /Rotate - whose value is a multiple of 90. The page's actual content is untouched: the text runs, the images, the vector drawings all keep their original coordinates. The viewer reads the rotation value and applies a transform as it renders. It's the difference between turning a photograph and re-photographing it at an angle.

This has three useful consequences. Quality is completely unaffected, because nothing is re-encoded - a rotated scan is pixel-identical to the original. File size barely moves, because you've changed one number. And rotation is perfectly reversible: rotating back restores exactly what you had, with no generational loss.

It also means rotation works identically on scanned and text-based PDFs. The distinction that governs so much other PDF behaviour simply doesn't apply here, because rotation operates at the page level and never inspects the content.

What we measured: how often, and what fixing one changes

We read 37,781 pages from 2,893 real documents (every file with 3 to 40 pages and at most 3 MB, from a fixed collection of 2009-era US government PDFs) and worked out, for every page with a text layer, which way its text runs as a viewer draws it. Then we fixed the sideways ones with HerePDF's own rotate code and read the files again.

Sideways text pages are rare, and a rotation setting is usually deliberate. Of 36,496 pages with text, 143 (0.4%) ran sideways or upside down, in 32 of the 2,821 files with text: text running up the page on 100, down it on 41, and upside down on 2. Meanwhile 2,715 pages (7.2%) carry a rotation setting and almost all of them show upright text: for most, the setting is how a landscape page is laid out, not a sign that something is wrong. Scanned pages have no text to read a direction from, so none of this counts them, and a scan is the case most people mean when they say a page is sideways. These figures say nothing about scans.

Fixing a page changes one number. For all 143 of the sideways pages, the turn worked out from the text, applied with HerePDF's rotate, made the text run left to right again (143 of 143). To test the tool on more than the rare natural cases, we also turned one real page in each of 374 documents by 90, 180 or 270 degrees on purpose, the way a mis-fed sheet does. The turn was found from the text for 374 of them, rotate put the page upright in 374, and the page's rotation setting was back to its original value in 374.

Nothing else moves. The content streams of every page in those files were the same bytes before and after (5,290 pages), the other 4,916 pages kept their rotation, and no file changed its page count. Against a copy saved by the same code, the rotated file was a median 99.7% of its size and never more than 100.0%. Against the original it came out a median 89.0%, because HerePDF rewrites the file as it saves it, and never larger than 99.8%. Every stream the document uses, page content, images and fonts included, was still in the rotated file byte for byte in 374 of 374 files, which is why quality does not change. (HerePDF drops streams that nothing refers to when it opens a file, such as leftovers of earlier edits and old metadata packets; 252 of these files had some.)

The limits: these are old government documents, not yours. A page counts as sideways when 60% or more of its characters run another way, so a mostly upright page with a sideways margin note is not counted. The deliberate turns are a test of the tool, not a measure of how often pages arrive turned. 102 of the 2,995 files are not counted: 99 were encrypted and the rest could not be read. In the tool you choose the turn by looking at the thumbnail, not by reading the text. The file names are not published, only counts; the data and the method are there to check against.

Fixing it permanently

What you need is a tool that edits the page rotation value and hands you a saved file. HerePDF's rotate tool does exactly that, in your browser:

  1. Drop the PDF in. Thumbnails of every page render locally so you can see which ones are wrong - useful when only some pages need turning.
  2. Rotate individual pages with the arrows under each thumbnail, or use the "all pages" controls when the whole document went in sideways. Rotated pages are outlined and labelled with their angle.
  3. Click apply. A new file is generated on your device with the corrected rotation written into each page, and you download it. The original on your disk is untouched.

Because the correction is stored in the document, everyone who opens the downloaded file sees it the right way up - including recipients whose readers would have ignored a view-only rotation.

The awkward cases

Every second page is upside down. Classic double-sided scanning, where the sheet feeder flipped alternate sides. Rotate the affected pages 180 degrees individually. There's no shortcut for "every even page" in most tools, so it's manual - but on a short document it's quicker than re-scanning.

The page is tilted, not rotated. A scan that went in slightly crooked is off by three degrees, not ninety. Page rotation can't help - it only does right angles. Fixing skew means actually resampling the image, which is a scanner-software or image-editor job (many scanning apps have a "deskew" option). Re-scanning is usually faster.

It looks right in one app and wrong in another. Usually a leftover view rotation in the app where it looks correct. Trust the app that shows it wrong - that's what the file actually says.

A photo you converted came out rotated. Phone cameras record orientation as EXIF metadata rather than rotating the pixels, and that metadata is often dropped during conversion. Rotate the image before converting, or fix the resulting PDF afterwards.

Checking it worked

Close the file completely and reopen the downloaded copy - not the tab you had open before. If it's still correct, the rotation is in the document. For certainty, open it in a different application, or email it to yourself and view it on your phone. A view-only rotation will not survive that trip; a real one will.

Frequently asked questions

I rotated the pages in my PDF reader but they were sideways again when I reopened it. Why?

Most readers rotate the view, not the document. It is a temporary display setting that is discarded unless you explicitly save the file. To make rotation permanent you need a tool that writes the new orientation into the page itself and produces a saved file.

Does rotating a page make the file bigger or reduce quality?

Neither. Rotation is stored as a single number on each page recording how far to turn it when drawing. No image or text is re-encoded, so quality is untouched and the size difference is a handful of bytes.

How common are sideways pages in real PDFs?

Rarer than the complaints suggest, in PDFs that have a text layer. In our test of 36,496 real pages with text, 143 (0.4%) ran sideways or upside down, in 32 of 2,821 files. Scanned pages have no text to read the direction from, so they are not in that figure, and it says nothing about scans.

Does rotating a page change anything else in the file?

Not in our test. We turned a real page by 90, 180 or 270 degrees in 374 documents and rotated it back with HerePDF: the page was upright again in 374, its rotation setting was back to the original value in 374, and the content streams of all 5,290 pages in those files were byte for byte unchanged, and so was the rotation of every other page.