PDF Deskew
Straighten tilted or skewed PDF pages with automatic angle detection and a manual fine-tune slider. All processing runs locally — never uploaded.
How to Use
Straighten a skewed PDF in four steps:
- Upload your PDF -- Drag and drop a PDF file or click the dropzone to browse. The tool renders the first page locally and shows it in the Before pane. Nothing is uploaded to any server.
- Auto-detect the skew -- Click "Auto-detect skew" to measure the page tilt. The detected angle appears as a badge (for example, +2.35° clockwise) and the correction is applied to the angle slider and the After preview automatically.
- Fine-tune if needed -- Drag the manual slider between -15° and +15° in 0.1° steps. Positive values rotate the content clockwise, negative values counterclockwise. The After preview updates live so you can judge the result visually before committing.
- Choose scope and download -- Apply the same correction angle to every page or to page 1 only, then click "Straighten PDF". The output file preserves your original page size and downloads as
name-deskewed.pdf.
Everything runs in your browser using PDF.js for rendering and pdf-lib for the page rotation. This makes the tool safe for confidential contracts, medical records, and unpublished manuscripts.
About This Tool
Deskewing is the process of rotating a document image by a small angle so that its text lines run perfectly horizontal again. Scanners, photocopiers, and phone cameras routinely introduce tilt of 0.5° to 5° when a page feeds through slightly crooked. Even a 1° skew is noticeable to readers and measurably degrades OCR accuracy -- research on document analysis consistently shows recognition rates dropping as skew grows, because text segmentation algorithms assume horizontal baselines.
This tool detects skew using the projection-profile method, a classic algorithm from document image analysis that needs no machine learning and no large dependencies. The rendered page is converted to grayscale, thresholded into an ink bitmap using Otsu's method, then swept across candidate angles from -15° to +15°. At each candidate angle the image is horizontally sheared and the row-by-row ink sums are measured. When the candidate matches the true skew, text lines collapse into a few high-contrast rows and the variance of the row sums peaks sharply. A coarse pass at 0.25° steps finds the neighborhood, then a fine pass at 0.05° steps refines the estimate -- the whole detection typically completes in under 200 milliseconds per page.
Correction is applied in vector form rather than by re-rendering pixels. Each corrected page is embedded into the output document as a PDF Form XObject and re-drawn with a rotation transform about the page center. Because the original content stream is reused verbatim, searchable text stays selectable, vector diagrams stay infinitely sharp, and embedded images keep their original compression. The page dimensions are unchanged; only the content orientation differs. Pages that do not need correction -- or that lack a content stream -- are copied into the output untouched, preserving annotations and links on those pages.
One inherent trade-off of any deskew operation is corner clipping. Rotating a rectangle inside its own bounds means the rotated corners extend past the page edge, and PDF viewers clip at the page boundary. For typical skews under 5° the clipped triangles at the corners are a few millimeters at most -- usually empty margin on scanned pages -- and the white background of the fresh page makes any uncovered corner areas invisible on scanned documents. If your scan has content running right up to the paper edge, compare the Before and After previews before downloading.
Why Use This Tool
Straightening a skewed PDF is worth the thirty seconds it takes in several common situations:
- Before OCR -- Text-recognition engines segment pages into lines assuming they are horizontal. A 2-3° skew can cut OCR accuracy noticeably; deskewing first restores baseline assumptions and improves extraction quality.
- Archiving scanned documents -- Batch scans from automatic document feeders often mix pages tilted left and right. A deskewed archive looks professional and reads comfortably on screen without constant head-tilting.
- Print preparation -- Crooked scans reprinted for filing or signing look sloppy. Straightening produces clean, aligned output for physical records.
- Forms and legal documents -- Signed contracts, applications, and official forms scanned at an angle can raise questions about document integrity in formal review; a straight copy avoids that friction.
- Downstream PDF tooling -- Cropping, margin measurement, table extraction, and page-dimension analysis all work better on aligned pages, since their geometry assumptions hold.
Related tools: PDF Rotate turns pages in 90° steps for landscape/portrait fixes. PDF Crop trims margins once pages are aligned. PDF Scanner Effect adds a scanned look to digital PDFs. PDF OCR extracts searchable text from your now-straightened scans. PDF to Greyscale prepares scans for monochrome printing.