Back to Blog
PDF Tools

How to Rotate PDF Pages (Free, Works on Any Device)

PDF-Builder Team·

How to rotate PDF pages (free, works on any device)

You scanned a stack of documents and half the pages came out sideways. Or someone emailed you a PDF where page 3 is upside down. Or you exported from landscape mode and the whole file needs a 90-degree turn.

Rotating PDF pages should be simple. It mostly is, once you know one thing that trips up almost everyone.


"I rotated it but it didn't save"

This is the single most common complaint in forums about PDF rotation. Someone opens their PDF in Adobe Reader, rotates the view, closes the file, reopens it, and the pages are back to their original orientation.

The reason: most PDF viewers distinguish between rotating the view and rotating the page. Rotating the view is temporary. It changes what you see on screen but doesn't modify the file. When you reopen the document, the rotation is gone.

To permanently rotate pages, you need a tool that actually modifies the PDF file itself. Adobe Reader doesn't do this. Adobe Acrobat Pro does, but it costs $20/month. The free options below all save the rotation permanently.


Method 1: Online tools

Online tools are the fastest way to rotate PDF pages if your document isn't sensitive. Upload, rotate, download.

Using iLovePDF as an example:

  1. Go to ilovepdf.com/rotate_pdf
  2. Upload your PDF
  3. Click the rotation icon on individual page thumbnails, or use the buttons to rotate all pages at once
  4. Choose the direction: 90 degrees clockwise, counterclockwise, or 180 degrees
  5. Click "Rotate PDF" and download the result

Other free options that work the same way: Smallpdf, PDF24, PDF2Go, and Sejda.

Most online rotation tools have no file-count limits for this specific task. Rotation is a lightweight operation compared to compression or OCR, so free tiers tend to be generous here.

The tradeoff is privacy. Your file gets uploaded to a remote server. For a flyer or a school assignment, that's fine. For a tax return, medical record, or signed contract, consider a local option instead. Our guide on PDF tool privacy covers what happens to uploaded files and which tools delete them.


Method 2: Desktop software

Desktop applications rotate pages on your computer without uploading anything.

Mac Preview

If you're on a Mac, you already have what you need. Preview handles PDF rotation without any extra software.

  1. Open the PDF in Preview
  2. Select the page(s) you want to rotate in the sidebar thumbnail view (hold Command to select multiple pages, or Command+A for all)
  3. Go to Tools > Rotate Left or Rotate Right
  4. Save the file (Command+S)

That's it. The rotation is permanent and saved to the file.

PDFsam Basic

PDFsam Basic is open-source and runs on Windows, Mac, and Linux. It has a dedicated rotation module.

  1. Download PDFsam Basic from pdfsam.org
  2. Open the app and select "Rotate"
  3. Add your PDF
  4. Choose the rotation angle (90, 180, or 270 degrees)
  5. Optionally specify a page range if you don't want to rotate all pages
  6. Choose an output location and click "Run"

PDFsam is also useful for splitting and merging, so it's worth installing if you work with PDFs regularly.

PDF24 Creator

PDF24 Creator (Windows) includes a page rotation tool with thumbnail previews so you can see each page before and after rotation. It's free with no feature limits.

For a broader comparison of desktop options, see our best free PDF tools roundup.


Method 3: Browser-based local tools

Browser-based local tools look like online tools but process your file entirely in your browser. Nothing gets uploaded to a server.

PDF-Builder works this way. Open the rotate tool, drop in your PDF, click the rotation arrows on individual pages or rotate all at once, and download the result. No account, no upload, no file size limit.

This is the middle ground between online tools (convenient but upload your files) and desktop software (private but requires installation). You get both convenience and privacy, the same approach that works for merging and compression.


Method 4: Mobile

Rotating a PDF on your phone depends on your operating system.

iPhone and iPad

The built-in Files app can't rotate PDF pages. Use the Markup tool instead:

  1. Open the PDF in Files
  2. Tap the Markup icon (pen tip) in the top right
  3. This opens an editing view, but it doesn't support page rotation directly

The better option on iOS is to open the PDF in a free app like Smallpdf or iLovePDF (both have iOS apps), rotate there, and save.

Android

Most Android phones don't have a built-in PDF rotation tool. Google Drive's PDF viewer can display rotated, but doesn't save the rotation.

Use a browser-based tool instead. Open Chrome, go to an online rotation tool or PDF-Builder, upload or select your file, rotate, and download. Browser-based tools work on any device with a modern browser, which makes them the most reliable mobile option.


Method 5: Command line

If you need to rotate PDFs in bulk or as part of a script, command-line tools are the way to go.

qpdf

Rotate all pages 90 degrees clockwise:

qpdf input.pdf output.pdf --rotate=+90

Rotate only pages 3 through 7:

qpdf input.pdf output.pdf --rotate=+90:3-7

Rotate page 5 by 180 degrees:

qpdf input.pdf output.pdf --rotate=+180:5

qpdf is fast, handles malformed PDFs well, and is available on Windows, Mac (via Homebrew), and Linux.

Python with pypdf

from pypdf import PdfReader, PdfWriter

reader = PdfReader("input.pdf")
writer = PdfWriter()

for page in reader.pages:
    page.rotate(90)  # clockwise
    writer.add_page(page)

writer.write("rotated.pdf")

To rotate only specific pages:

from pypdf import PdfReader, PdfWriter

reader = PdfReader("input.pdf")
writer = PdfWriter()

pages_to_rotate = [2, 4, 6]  # zero-indexed: pages 3, 5, 7

for i, page in enumerate(reader.pages):
    if i in pages_to_rotate:
        page.rotate(90)
    writer.add_page(page)

writer.write("selectively-rotated.pdf")

Ghostscript

Rotate all pages 90 degrees:

gs -sDEVICE=pdfwrite -dAutoRotatePages=/None \
   -c "<</Orientation 1>> setpagedevice" \
   -f input.pdf -o rotated.pdf

Ghostscript is more verbose than qpdf for rotation. If you only need rotation, qpdf is simpler. Ghostscript is better when rotation is one step in a larger processing pipeline.


Rotating scanned documents

Scanned PDFs are the most common source of rotation problems. Flatbed scanners and phone scanning apps don't always detect page orientation correctly, especially with mixed-orientation originals (some portrait, some landscape in the same batch).

A few things to know:

Rotating a scanned PDF is the same as rotating any other PDF. The methods above all work. The scan is stored as an image embedded in a PDF wrapper, and rotation applies to the whole page including the image.

OCR before or after rotation both work. If you plan to run OCR on a scanned document, you can rotate first and then OCR, or OCR first and then rotate. Modern OCR engines (including the one in Adobe Acrobat) can handle sideways text. But rotating first makes the OCR output easier to verify visually.

Some scanners have auto-orientation. Check your scanner settings before rescanning. Many scanners and scanning apps (including Adobe Scan and Microsoft Lens) have an auto-rotate option that detects text direction and corrects orientation during the scan. This can save you from having to rotate after the fact.


Rotation angles explained

PDF rotation works in 90-degree increments. You can't rotate a page by, say, 45 degrees (that would require rasterizing the page into an image, which is a different operation).

The four options:

  • 90 degrees clockwise turns a portrait page to landscape (text reads top-to-bottom on the right side). This is the most common rotation for fixing sideways scans.
  • 90 degrees counterclockwise turns the same portrait page to landscape in the other direction. Use whichever direction makes your sideways page right-side up.
  • 180 degrees flips a page upside down. Use this for pages that were scanned with the paper facing the wrong direction.
  • 0 degrees (or no rotation) keeps the page as is. Useful in command-line tools when you're rotating a range but want to skip certain pages.

If you're unsure which direction to rotate, just try 90 degrees clockwise. If the page ends up wrong, rotate it again. Two 90-degree rotations equal 180, and three equal 270 (which is the same as 90 counterclockwise). You can always get to the right orientation.


Tips

Rotate before adding page numbers. If you're going to add page numbers to your PDF, rotate all pages to their correct orientation first. Page numbers added to a sideways page will end up in the wrong position.

Check individual pages. A common mistake is rotating the entire document when only some pages need it. Open the thumbnail panel, scroll through, and identify which specific pages are off before rotating.

Keep the original. Save the rotated file as a new copy rather than overwriting the source, at least until you've confirmed the result is correct.

Batch rotation with command-line tools. If you have a folder of scanned PDFs that all need the same rotation, a short shell script with qpdf can process them all in seconds:

for f in *.pdf; do
    qpdf "$f" "rotated-$f" --rotate=+90
done

Summary

Rotating PDF pages is straightforward once you pick the right tool for your situation.

For a quick fix on a non-sensitive file, use an online tool like iLovePDF or Smallpdf. For privacy, use a browser-based local tool like PDF-Builder or desktop software like PDFsam. On a Mac, Preview handles it natively. For bulk processing or automation, qpdf or pypdf on the command line.

The key thing to remember: make sure your tool saves the rotation to the file, not just to the view. If you rotate in a viewer and the pages go back to their original orientation when you reopen, you need one of the tools listed above.