You can handle this directly in your browser with our free pdf to images tool — nothing gets uploaded.
A freshly saved scan often arrives crooked, with the top edge of the page tilting a few degrees to the left or right. This happens more often than most people realize because phone cameras rarely sit perfectly parallel to the paper they are photographing. The good news is that most modern scans are tilted only a few degrees, which is exactly the range that automated tools can correct without manual effort. This article explains why scans get skewed in the first place, how to tell whether a file needs a simple rotation or a more involved perspective correction, and the practical steps for straightening both single pages and large batches.
Phone scans produce tilted images for a handful of physical reasons. The most common one is that the camera lens is not parallel to the page surface. Holding a phone above a sheet of paper and looking down through the screen introduces a small angle between the lens plane and the paper plane, and that angle translates directly into a rotated rectangle in the captured image.
Perspective distortion is the second major cause. When the phone is held close to one edge of the page and farther from the other, the near edge appears larger than the far edge. The page no longer looks like a rectangle; it looks like a trapezoid. Even when the tilt is mild, the distortion is enough to make straight lines in the document curve or slant in the output image.
Uneven lighting makes all of this worse. A room with a single overhead lamp casts a gradient across the page, darkening one corner and brightening the other. The camera's automatic exposure tries to compensate, and the algorithm that later looks for page edges loses accuracy in the darker corners. The result is a scan whose detected boundary is slightly off, and the straightening step either over-rotates or under-rotates.
Paper that is slightly curled, creased, or fed through a scanner at an angle contributes as well. A curled sheet does not sit flat on the scanner bed, so the captured page boundary is wavy rather than straight. This last point matters because curling cannot be fixed by rotation at all; it requires rescanning with the page flattened.
It is important to distinguish two operations that are often called by the same name but are different in practice.
Deskew handles small rotations, typically anything up to about ten degrees. The page boundary is still recognizably rectangular; the whole rectangle has simply been turned. A deskew algorithm rotates the image around its center by the detected angle and trims or pads the corners. Because the underlying shape is still a rectangle, a single rotation value is enough to fix the page.
Perspective correction handles larger tilts where the page no longer looks like a rectangle at all. The captured shape is a quadrilateral, usually close to a trapezoid, and fixing it requires locating the four corners and warping the image so that they map back onto a clean rectangle. This is a fundamentally different operation from a plain rotation; rotating a trapezoid by any angle does not produce a rectangle, so deskew alone will not be enough. Perspective correction also demands four corner detections instead of one angle, which is why it is slower and more error-prone, and why it is best to use it only when the tilt is clearly large.
A quick rule of thumb: if you can estimate the tilt by eye and it is small, deskew is the right tool. If the page visibly narrows on one side and widens on the other, you are in perspective territory and should use a four-corner correction instead.
Most automated deskew tools follow the same three-stage pipeline. First, the software finds a reference structure inside the page. The two common references are the text baselines, which are the nearly horizontal lines formed by the bottom of letters in each line of text, and the page edges, which are the long straight borders of the paper. Text baselines are usually the more reliable reference because they are dense, high-contrast, and easy to segment, while page edges can disappear if the background is the same color as the paper or if the lighting is uneven.
Second, the tool measures the orientation of that reference. For baselines, it runs a Hough transform or a similar edge-orientation histogram over the binarized image and reads off the dominant angle. For page edges, it finds the longest straight lines in the boundary and averages their orientations. Either way, the result is a small set of candidate angles, one for each detected line.
Third, the tool picks the most plausible angle from the candidates. Taking the median is the standard choice because it resists outliers: if one long line happens to be detected at the wrong angle, the median of the rest of the lines still points at the true orientation. The image is then rotated by that median angle and the corners are trimmed or padded so the page fills the new frame.
The simplest route is to let the phone scanner app do it at capture time. Most mainstream scanner apps run an auto-crop step that finds the four corners of the page and a deskew step that rotates the cropped result so the text lines are horizontal. Open the app, frame the page so the whole sheet is visible with a margin of background around it, tap the shutter button, and let the app finish its processing. The preview will usually show the corrected page. If it still looks tilted, some apps expose a manual fine-tune slider; rotate the preview by one or two degrees until the text lines look level. Save the result as a PDF or image and stop there for single pages.
For higher quality or for files that a phone app could not handle, open the scan in a desktop program that supports image rotation. The workflow is the same: let the program detect the angle automatically if it offers that option, then confirm visually. If the automatic value looks off, rotate by hand in one-degree increments, checking the text baselines each time. Save the corrected file. Because desktop tools work on raster pixels, they can also trim the white corners that appear after a rotation, producing a clean rectangular page rather than a tilted rectangle with white wedges in the corners.
If the scan is already embedded as a PDF and you only need to straighten one or two pages, you do not need a full image editor. Most PDF viewers have a page-rotation control that turns the entire page by ninety-degree increments. That control is not what you want for a skewed scan; it cannot produce a two-degree correction. Instead, open the PDF in a viewer that lets you set an arbitrary rotation angle, or export the page to an image, deskew the image in a desktop tool, and import the corrected image back into a new PDF. For a handful of pages this is the most direct fix, because there is no batch processing to set up.
A large scan such as a bound report or a photo album has pages that are not tilted the same amount. The top of the stack may be perfectly level while the middle pages are rotated two degrees and the bottom pages are skewed the other way. The correct batch approach is to process every page on its own: run the angle detection on page one, rotate page one by its own detected angle, then run detection again on page two, and so on. Do not estimate one angle from the first page and apply it to the whole file; that is the single most common mistake when deskewing batches. A batch tool that advertises per-page deskew will handle this for you, but if you are scripting it yourself, make sure the loop rotates each page individually instead of computing one global angle and applying it once.
The first mistake is over-rotating. If the detected angle is three degrees and you manually add another two degrees because the result still looks slightly off, you have now tilted the page in the opposite direction. Trust the detected value for the first pass, look at the text baselines after rotation, and only make a second correction if they are clearly not level.
The second mistake is trying to deskew a scan that is warped rather than tilted. A curled sheet of paper produces a wavy page boundary, not a clean rectangle. No rotation angle will make a wavy boundary straight, because rotation preserves shape. The fix is to rescan the page with the paper flattened, either under a scanner lid or with a weighted board on top of it on a phone camera. Rotating a warped scan just moves the wavy boundary; it does not remove the wave.
The third mistake is applying one rotation value to a multi-page file whose pages are each tilted differently. This is the batch version of the first mistake. A file made by scanning a stack will almost always have per-page variation, so each page needs its own detection and its own rotation. A single global rotation will leave most of the pages still crooked, often in opposite directions.
Deskew assumes the page is still a rectangle that has simply been turned. Once the tilt is large enough that the page looks like a trapezoid, a plain rotation will no longer straighten it; rotating a trapezoid by any angle still leaves it a trapezoid. This is the perspective case, and the right tool is a four-corner correction that detects the four corners of the captured page and warps the image so they land on a clean rectangle.
In practice, do not reach for perspective correction on every scan. Reserve it for pages where you can see the trapezoid shape with your eye, where one side is clearly longer than the other, or where the deskew step leaves the page visibly slanted after a reasonable rotation. For those pages, run the perspective step after the deskew step, or run a combined capture that does both in one pass. If the page was photographed from a steep angle, the better fix is usually to retake the photo with the camera held as parallel to the page as you can manage, because perspective correction on a very steep capture loses a lot of detail along the near edge.
How many degrees can deskew correct automatically?
Most automated deskew tools handle angles up to roughly ten degrees reliably. Beyond that, the page usually looks trapezoidal rather than merely rotated, and you should use a four-corner perspective correction instead of a plain rotation.
Why does my batch scan still look crooked after I ran the deskew tool?
The most likely cause is that the tool applied one global rotation to the whole file instead of detecting and rotating each page individually. Open the batch output and check a page near the start, one near the middle, and one near the end; if they are tilted in different directions, the tool did a global rotation. Rerun it with per-page detection enabled.
Can I fix a curled or wavy scan by rotating it more?
No. Rotation preserves the shape of the page boundary, so a wavy boundary stays wavy after any rotation. A warped scan needs to be rescanned with the paper flattened; rotating it will not remove the curl and will only move it.
Related reading: annual review scan reconcile paper records, batch ocr scanned pdfs, car repair records scan before selling.
What is a skewed scan?
A skewed scan is an image where the text or content lines are tilted at an angle relative to the horizontal axis. This usually happens when a paper document is not aligned perfectly parallel to the scanner bed during the capture process. Most browser-based deskew tools automatically detect this angle and rotate the page to make the lines perfectly horizontal again.
How accurate is automatic deskew detection?
Automatic detection algorithms generally calculate the average rotation angle required to make text lines horizontal. Accuracy can vary depending on image resolution and contrast. For pages with complex layouts, low resolution, or poor lighting, manual adjustment often yields better results. Always preview the output to verify the correction is appropriate.
Can I deskew multi-page PDFs?
Yes, most browser tools process each page individually. This is crucial because pages may have different skew angles. The tool calculates the optimal rotation for each specific page separately before reassembling them into a single document. Ensure your file is under the maximum upload limit to process large documents successfully.
Does deskewing change file size?
Deskewing primarily rotates the image data, which may slightly alter file size due to re-compression. However, the overall document size usually remains stable. Some tools allow you to adjust compression settings after correction. For archival purposes, saving as a lossless format like TIFF is recommended to maintain maximum quality without unnecessary data loss.