Deskew PDF

Straighten slightly tilted scanned pages with automatic angle estimates or page-by-page manual correction, then create a rasterized corrected copy.

Choose a PDF or drag it here

Designed for scanned PDFs with small page tilt

What Deskewing Fixes

Deskewing corrects a small rotational error in a scanned page: text baselines that should be horizontal instead rise or fall slightly across the page. This often happens when paper is not perfectly square on a scanner bed or when a document is captured by camera at a small angle.

This tool searches automatically within +/-5 deg because it is aimed at scan skew, not pages that are sideways. The manual control allows corrections from -10 deg to +10 deg when the automatic estimate needs adjustment.

A page rotated by 90 deg, 180 deg, or 270 deg is an orientation problem rather than ordinary skew. Use a page-rotation tool for that case.

How Automatic Skew Detection Works Here

Each page is rendered at reduced resolution and converted into a set of dark sample pixels. The detector tests small candidate rotations and scores how strongly those pixels line up into horizontal rows. The angle with the strongest row structure is inverted to become the correction angle.

That approach works best on ordinary scanned text because letters create repeated horizontal line structure. Blank pages, photographs, diagrams, handwriting, forms with heavy borders, or image-heavy pages can produce weak or misleading estimates.

Automatic detection is therefore an estimate, not a guarantee. The page-by-page preview is there so you can verify and override individual angles before export.

Why the Output Is a Rasterized PDF

The browser renders each source page to a canvas, rotates that raster image by the chosen correction angle, and embeds the corrected image into a new PDF page. That makes small-angle rotation practical and visually predictable in the browser.

The tradeoff is important: selectable text, vector graphics, links, annotations, form fields, bookmarks, and other interactive PDF structures are not preserved as original PDF objects. They become part of the rendered page image.

If you need to preserve searchable text or interactive form behavior, this raster deskew workflow is not the right operation for that document.

What Happens at the Page Edges

Page size stays stable

The corrected page keeps the rendered source page's width and height rather than expanding the PDF page to contain a larger rotated bounding box.

Tiny corner areas can be clipped

Rotating a rectangle inside the same-size rectangle necessarily pushes small corner regions outside the canvas. The tool fills exposed areas white, so always inspect pages where important marks sit very close to an edge.

Deskew PDF FAQs

Can every page have a different correction angle?

Yes. Auto-detect stores an estimate for every page, and the page selector lets you inspect and override any individual page from the document.

Why does automatic detection sometimes choose 0 deg?

A blank or very sparse page may not contain enough dark line structure to estimate skew reliably. In that case the detector deliberately falls back to no correction.

Does deskewing preserve searchable text?

No. This implementation rasterizes every page into a corrected image before rebuilding the PDF, so original selectable text and vector objects are not preserved as such.

Will the output file size change?

Usually. Every page is re-encoded as a PNG image inside a new PDF, so output size depends on page dimensions and image complexity rather than the original PDF compression.

Can it straighten a page that is sideways?

Not as its intended use. Automatic detection searches only +/-5 deg, and manual correction is limited to +/-10 deg. Use page rotation for quarter-turn orientation problems.

Why might text near a corner disappear after correction?

The page keeps its original rendered dimensions. A rotated rectangle extends beyond those dimensions at the corners, so a small amount of edge content can be clipped.

Does this upload the PDF?

No upload request is made by this component. PDF.js renders and analyses the selected browser File locally, and pdf-lib creates the corrected raster PDF in the browser.

Why can a long scanned PDF take significant memory and time?

Deskewing requires rendering each page to a bitmap and then encoding another bitmap for the output. The revised component reuses one PDF.js document instead of reopening the entire PDF for every page, but raster processing is still inherently memory- and CPU-intensive.

Related Tools