PDF Rotator for Clockwise and Counterclockwise Turns

Printed pages sometimes scan sideways, and phone cameras capture receipts and whiteboards at an angle. This page reads the PDF you pick, applies the chosen turn to each target page, and writes a new file you can download immediately. The rewrite only touches the rotation field stored with each page, so text, fonts, and images are copied through unchanged. Range input lets you fix a handful of crooked pages without touching the rest.

Rotate Pages in Any Direction

One source, one rotated copy All processing runs in your browser.

Source document

Pick one PDF file. Encrypted or damaged files fail to load and are reported below.

Rotation settings

Run rotation

No rotation run yet.

How It Works

Loading a file runs pdf-lib in the tab. When you press Rotate pages, the document is parsed again in memory, each target page is fetched by its zero-based index, and the chosen turn is added to the angle the page already stores. The angle is written back with a degrees wrapper, and the saved file records FlowStack Tools as the producer so the edit shows up in document properties.

Every page keeps its own rotation as a multiple of 90 in the page /View entry, and readers apply that angle on top of the stored content stream. The stored angle plus the chosen turn is reduced modulo 360, so the result always lands on 0, 90, 180, or 270. Counterclockwise is implemented as 270 degrees of clockwise rotation, which is the same as a left turn and stays inside those four values.

Because each run starts from the angles already stored, repeated runs stack. A page sitting at 90 that receives another 90 ends at 180, and four clockwise turns return the page to 0. An empty range box means every page, and typed ranges accept the same syntax as the splitter tool: commas between groups, closed ranges such as 2-7, open ranges such as 8-, and a leading dash such as -3.

Problems in the range text appear under the button, and a run whose target list ends up empty stops before any file is written. The download link appears only after the save finishes, and a new run replaces the previous link so only the latest bytes stay in memory.

Direction Degrees added Net effect
Rotate 90° clockwise +90 Top edge moves to the right
Rotate 90° counterclockwise +270 Top edge moves to the left
Rotate 180° +180 Page turns upside down

Before and After

Before (scan stored sideways)
receipt.pdf   4 pages
page 1 rotation: 0
page 2 rotation: 0
reader shows pages 1-2 rotated left
After (clockwise run, all pages)
Rotated 4 pages by 90 degrees clockwise
page 1 rotation: 90
page 2 rotation: 90
[ Download rotated.pdf ]
Before (range typed past the end)
range: 9-2, 20-
"9-2" is reordered to 2-9
"20-" starts past page 12
After (range fix on mixed pages)
range: 2,5-7
Rotated 4 pages by 90 degrees counterclockwise
pages 1, 3-4, 8-12 keep their angles

Use Cases

Developer Production Workflow
Straighten demo PDFs bundled with a web app Fix batch scans before OCR processing Correct phone photos of whiteboards
Align fixture PDFs before visual snapshot tests Repair mixed-orientation print queues Flip sideways receipts for expense upload
Exercise every rotation angle in a PDF viewer Prepare signed contract scans for archiving Turn a landscape form upright before filling it in

Common Mistakes

  • Expecting the page pixels to redraw. The tool stores a new angle on each page; software that ignores rotation flags still draws the original direction.
  • Running 90 degrees clockwise twice and expecting an undo. Two clockwise turns equal 180, and four clockwise turns return the page to its starting angle.
  • Typing a reversed range such as 7-2 and skipping the note. The range parser reorders it to 2-7 and reports the change under the button.
  • Adding page numbers or watermarks before fixing orientation. Downstream tools print in the current page space, so rotate first and then run the other tool on the saved file.
  • Leaving a range from an earlier, longer file in the box. Groups that start past the last page are flagged and skipped, which shrinks the run without an obvious failure.

Best Practices

  • Load the file first and read the page count from a quick all-pages dry run, so every number you type into the range box lands inside the document.
  • Use counterclockwise, which adds 270 degrees, for a left turn instead of running clockwise three times.
  • Download after each run when a document mixes portrait and landscape groups, because the next run reads the angles the last run stored.
  • Keep the default 90-degree clockwise direction for scanner output, which is the most common sideways case, and switch to 180 only for pages that are inverted.

Frequently Asked Questions

Why do my scanned pages open sideways?

A scanner or phone camera often captures a page upright but stores the image without a matching orientation flag. PDF readers trust the rotation entry inside the file, so a sideways scan stays sideways until that entry changes. This tool rewrites the entry, and most readers redraw the page the right way up.

Can I rotate only some pages and leave the rest alone?

Yes. Type the pages you want in the range box, such as 2,5-7. Only the listed pages receive the new rotation; every other page keeps the orientation it already had. Leave the box empty to rotate every page.

Is the rotation permanent once I download the file?

The change is a rewrite of each page /View entry inside the PDF, not a redraw of the page contents. The new angle is saved in the file, so it survives download and upload, and most readers honor it from then on. A few specialized tools that ignore rotation flags may still draw the original image direction.

What if a document mixes portrait and landscape pages?

Rotate each group separately. Set the range to the portrait pages, run the tool, download the file, then load that result and rotate the landscape group the other way. Because each run starts from the current angles, a second pass adds to whatever the first pass stored.

Does rotating change the file size?

Almost never in a noticeable way. The page contents and images are copied unchanged; only the small rotation field on each targeted page is edited. The rewritten file can differ by a few hundred bytes from the source, either up or down, depending on how the library rebuilds the structure.

Can I combine rotation with page numbers?

Yes. Rotate first and download the result, then load that file into the page numbers tool. Numbering tools usually print in the page coordinate space, so starting from correctly oriented pages keeps the numbers aligned with the text.

Does this work on a phone or tablet?

Yes. The page runs in the browser, so a modern phone browser can pick a local PDF, rotate it, and hand back a download. Very large files are smoother on a desktop because the whole document is held in memory while it is rewritten.