Why does your scan keep coming out crooked?
The scan is readable. It is just leaning, by two or three degrees, the way a photocopy from 1994 leans. You did not put the paper in crooked — you squared the stack against the guide and watched it go in.
And it is not every page. Page 4 is fine, page 5 leans left, page 6 leans left by a different amount. Which rules out the theory that you are bad at putting paper in trays.
Everything written about this tells you how to straighten it, and nothing tells you what the machine is doing — which is the part worth knowing, because a scanner that does this today will do it again on Thursday.
What the feeder is doing to your paper
A sheet-fed scanner does not photograph a page. It pulls the page past a sensor bar that reads one thin line at a time and builds the image out of those lines in the order they arrive. The paper moves; the camera does not. So how the scan looks is a statement about how the paper travelled.
The paper is driven by a rubber pick roller pressing it against a separation roller that pushes back, so only one sheet goes at a time. That pair grips the sheet across a narrow strip. If the grip is not even across that strip — more friction on the left than on the right — the sheet does not only move forward, it turns. A fraction of a degree per centimetre of travel is enough, and by the time the trailing edge is through, the page is three degrees out.
Which makes every cause worth checking a way for one side of a sheet to be gripped harder than the other:
The rollers are glazed, not worn out. Paper sheds a fine dust, and toner and paper coating polish the rubber into a hard shiny film, and a glazed patch slips. Rollers rarely glaze evenly: the middle sees every sheet and the ends see only the wide ones. That is why the fault comes on gradually, and why cleaning fixes it more often than replacing does.
The edge guides were left wide. Guides do not straighten paper; they stop it wandering. A stack sitting 5 mm clear of both guides enters the nip already rotated, and the nip faithfully preserves the angle it was given.
The stack was not jogged. If the leading edges are not flush, each sheet meets the rollers at its own angle — the fingerprint of a different angle on every page.
One sheet is not like the others. A dog-eared corner, a staple hole, a fold, a sheet that came out of a printer curled: each changes where the grip starts. One bad page in twenty is the paper.
Most feeders try to correct all of this by driving the sheet into a stalled roller pair so the leading edge buckles square before the drive starts. It works well on ordinary office paper and much less well on thin, stiff or glossy stock, which is why the same scanner handles your letters perfectly and makes a mess of a stack of invoices on card.
Read the angles, not the pages
You do not have to guess which of those it is. The pattern across the document names the cause.
- Every page tilted the same way by roughly the same amount. Something fixed is out of true: a guide that is itself skewed, or one roller doing more work than its partner. Consistent means findable, and it means the next batch comes out at the same angle until someone opens the lid.
- Random angles, both directions, page to page. Entry variation — guides, jogging, curl. Nothing is broken.
- The tilt grows through the stack. The stack is shifting as it lightens, or the output tray is backing up and dragging on the sheets still coming through.
- Only the backs are wrong. A duplexing feeder reverses each sheet through a switchback path, which is a second chance to skew. If the backs are not tilted but upside down, that is not skew at all — it is a 90 or 180 degree turn, and Rotate PDF fixes it by writing the angle into the page rather than redrawing anything, so nothing is lost and the file does not grow.
- The black band down one edge is a wedge, thick at one end. That band is the scanner's backing showing where your paper was not, so a wedge is a direct measurement of the skew — the band itself is the lid or the backing plate, not damage.
Three things that look like skew and are not
A book on the glass. Near the spine the paper lifts away from the platen and curves, and the lines of type curve with it. Nothing is tilted; the page is warped, and no rotation undoes a curve. That needs dewarping, or a flatter original.
The sheet turned while it was moving. The image is built line by line as the paper travels, so if the sheet rotates mid-feed, the top of the page was captured at one angle and the bottom at another. That is a sheared page, not a rotated one. The test takes five seconds: lay a straight edge along the left margin of the text. Straight but sloped is honest skew and can be corrected. If the margin bends, no amount of turning fixes it, and re-feeding that one sheet is quicker than anything else you might try.
A photograph of a page. Hold a phone over a document and you get perspective: the near edge of the paper is longer than the far edge, so the page is a trapezium, not a tilted rectangle. Rotating a trapezium gives you a rotated trapezium. That needs a four-corner correction — the document mode in your phone's camera app — and no page-straightening tool can do it. A quarter turn is a different thing again and usually looks after itself: our JPG to PDF reads a JPEG's EXIF orientation tag, so a photo taken with the phone held sideways comes out the right way up in the PDF, and when one does not, the tag was stripped on the way.
Ten seconds more before you reach for any tool: if the crooked page has real, selectable text on it, nothing scanned it — someone drew the content at an angle. Our PDF inspector says whether a page carries a real text layer without uploading the file anywhere, and OCR PDF gives the same answer as a per-page list for a long document. Read its notice first: it reports which pages are text and which are pictures, and cannot add a text layer, because the recognition engine is not installed here.
Straightening the pages you already have
- Crop first if there is a border. A black band, a strip of the next sheet, punch holes down the margin — all of it is ink as far as an angle measurement is concerned, and a solid dark edge drags the answer. Crop PDF takes millimetres off any side.
- Set the page range to the pages that are actually crooked. Pages you leave out are copied across byte for byte, keeping their text, links and sharpness.
- Leave the tilt range at 10 degrees for prose, and drop it to 3 or 4 for forms and tables. The angle is found by squashing the page's ink onto the vertical axis and looking for the angle at which the ink piles into distinct rows — which is exactly what lines of type do, and exactly what a page of ruled boxes does not. A big search range on a table gives the search more wrong answers to find.
- Raise the resolution above the 200 dpi default if the scan was made at 300 or more. The corrected page is redrawn at whatever you set, and what it drops is not recoverable afterwards.
- Read the reported angles. Deskew PDF tells you what it found on each page — "page 7 was turned 2.4° clockwise" — and that list is the diagnostic from the section above, handed to you for free.
Stopping it at the machine, which is the only permanent fix
Five minutes here beats straightening every batch for the next year.
- Clean the rollers. A lint-free cloth with isopropyl alcohol, or the maker's cleaning sheet. Turn each roller as you go so you cover the whole circumference, and let it dry before feeding paper. This alone fixes most skew that came on gradually.
- Check the consumable counter in the driver. Scanners count the sheets they have fed and the rollers are rated for a number, often around 100,000; past that, cleaning buys weeks, not months.
- Jog the stack on a flat surface, both edges, before it goes near the tray.
- Close the guides until they touch. Touching, not gripping: a stack squeezed between guides buckles and feeds worse than one left loose.
- Feed fewer sheets. Half a tray of a stiff stock feeds straighter than a full one.
- On a flatbed, use the registration corner — the arrow etched on the glass — and hold the sheet while the lid comes down. A light sheet slides several millimetres under a closing lid.
- Turn on the driver's own deskew. It is the best place to do it, because the driver has the raw sensor image before any JPEG compression, before any downsampling, and before the page becomes a PDF. Anything done later is a second-generation correction of a first-generation mistake.
When a desktop tool is better
If this is a weekly job, or the document is a book, stop doing it in a browser.
- OCRmyPDF —
ocrmypdf --deskew --clean in.pdf out.pdfstraightens each page image, cleans the scanner grime off the edges and adds the searchable text layer in one pass. This is also the answer to the ordering question, because doing it here means the page is resampled once rather than twice; which of straightening and recognition goes first is worth getting right. - ScanTailor Advanced is the tool for the book case. It deskews, splits spreads, squares the margins and — the part nothing else here does — dewarps the curve out of pages photographed near a spine, with a preview of every page.
magick in.png -deskew 40% out.pngif you have ImageMagick and one page to fix.
What straightening will not do
It cannot tell you which of the causes above is yours. It measures the file. The angles are evidence; the diagnosis is still a person looking at a machine.
A corrected page stops being text. The page has to be resampled to be turned, so it comes back as a picture: no selecting, no searching, no screen reader, no links or comments. Pages it decides were already level keep everything, which is why the page range matters.
The file gets bigger. Every corrected page becomes a JPEG. Run Compress PDF afterwards if it has to be emailed — a page of grey pixels is exactly the case compression is good at, so the cost is usually recovered.
Under a tenth of a degree, it does nothing at all and says so. If it reports that every page was already level and you can still see a slope, believe the tool: what you are looking at is a curve, a shear or a perspective, and the answer is in the section above rather than in a straightening tool.