โ—† ClientPDF
running locally in this tab โ€” nothing uploaded

Why are my page numbers sideways or in the wrong corner?

You added page numbers, the tool said it worked, and the download opened โ€” but the number is on the left edge instead of the bottom, or it's printed sideways, or upside down. Nothing crashed. The file isn't corrupted. There's one specific, well-understood reason this happens, and it's almost always the same one.

PDF pages have a rotation flag that's separate from their content

Every page in a PDF has a fixed content area (its media box) and, separately, an optional /Rotate value โ€” 0, 90, 180, or 270 โ€” that tells a viewer "display this page turned by this many degrees." The underlying content coordinates never move. Only the on-screen (or on-paper) presentation does.

That split exists for a good reason: it lets a scanner or phone app fix a sideways scan instantly, just by writing one flag, instead of re-encoding every pixel on the page. But it means two different tools can disagree about "where the bottom of the page is" โ€” one sees the raw coordinate space, the other sees the rotated, as-displayed page.

Where the mismatch comes from

Stamping a page number means calculating a position โ€” usually "10 points up from the bottom, centered" โ€” and drawing text at that x/y coordinate. That calculation happens in the page's raw, unrotated coordinate space. If the page also carries a non-zero /Rotate flag, the viewer then rotates everything, including the freshly stamped number, when it displays the page. A number placed at the visual bottom-center of an upright page can end up on the left edge, the right edge, or upside down, depending on the flag's value โ€” because "bottom" in coordinate space and "bottom" as displayed are no longer the same thing.

This isn't a bug specific to one tool โ€” it's a consequence of how the PDF spec separates content from display rotation, and it trips up any numbering or stamping tool that doesn't explicitly check each page's rotation before choosing where to draw.

Which files are most likely to hit this

How to fix it

  1. Open the file and check whether any pages display sideways or upside down before you number them โ€” that's the visual sign a /Rotate flag is set.
  2. If so, run it through the rotate tool first and save the corrected file.
  3. Then add page numbers to that corrected file, not the original.

Numbering after a rotation pass sidesteps the mismatch: by the time the number is stamped, "bottom" in the file's coordinate space and "bottom" as displayed are the same place again.

Try it yourself: rotate a PDF to its correct orientation, then add page numbers to the result. Both run entirely on this device โ€” no upload, no account.