Document Scanner

Upload a photo of a document taken at an angle and drag the four corner handles onto its edges. The tool computes a perspective transform (homography) to flatten it into a rectangular scan. Adjust brightness and contrast afterward, then download as PNG or JPEG.

PrivateFreeWorks offline

Reviewed by Vincenzo Manto, Founder & Lead Developer · Last updated September 27, 2026

How it works

  1. 1

    Upload a photo of a document, receipt, or page taken at an angle.

  2. 2

    Drag each of the four corner handles onto the document's actual corners.

  3. 3

    Click Scan. The tool computes the perspective transform and renders a flattened rectangle.

  4. 4

    Adjust brightness/contrast and download the result as PNG or JPEG.

Real projective geometry, not a crop

A simple crop can't fix a document photographed at an angle, since the page still looks like a trapezoid. This tool works out the actual math: given four source points and four destination points, it derives the homography matrix that maps one onto the other, then warps every pixel through it. That's the same underlying technique used by dedicated scanning apps.

Manual corners for reliability

Automatic edge detection often fails on wooden desks, patterned backgrounds, or documents with torn edges. Letting you place the corners yourself means the tool works on any photo, background, or document shape, since you decide exactly what gets flattened.

Frequently asked questions

How does the perspective correction actually work?

It computes a 2D homography, a 3x3 projective transform matrix, that maps the four corners you marked to the corners of a perfect rectangle, using the standard direct linear transform (DLT) method. Every output pixel is then sampled back from the source photo through the inverse of that matrix.

Does it detect the document edges automatically?

No. Edge detection is left out on purpose, so you position the four corner handles yourself. That tends to work better than automatic detection on cluttered backgrounds or low-contrast paper.

Is my photo uploaded to a server?

No. The image is decoded and processed in your browser with the Canvas API, and the pixel data stays on your device.

Why does the output rectangle's size vary depending on my corners?

The output width and height come from the actual pixel distances between your marked corners, using the longer of the top/bottom edges and the longer of the left/right edges. That way a document scanned at a slight angle still ends up with a natural aspect ratio.

Can I improve a scan that came out too dark or washed out?

Yes, use the brightness and contrast sliders after scanning. They apply a standard contrast/brightness curve to every pixel, and you can re-scan and adjust again as many times as you like before downloading.

Related tools