Skip to content

Scan a document from a photo: a straight A4 or Letter page

Take a photo of a page, upload it and click its four corners. You get a straightened A4 or Letter page, in colour, grey or black and white, to download as a PNG or a PDF. The photo is processed in your browser.

Opens without an account 3 times a day. A free account removes the limit.

Scan a document from a photo: what it is

This document scanner online is a free tool from EduFacturing for when there is no scanner at hand but there is a photo of the sheet. You click the four corners, and the tool works out the distortion and builds the straightened page pixel by pixel.

The output is colour, grey or black and white; in black and white a local Sauvola threshold cleans the background, so a shadow from your hand does not blacken the whole page.

Document scanner online: the Photo of the document card with the file review-card-print.png chosen, below it the card Click the four corners of the page with the order 1 to 4 and a loaded dark card with five stars and a QR code
Document scanner online: the Photo of the document card with the file review-card-print.png chosen, below it the card Click the four corners of the page with the order 1 to 4 and a loaded dark card with five stars and a QR code

Photo of a page to PDF

Straightens by four corners

You click the corners in order: top-left, top-right, bottom-right, bottom-left, and can drag any point. An outline with an area under 400 px² or one that is not convex is rejected with an explanation.

Gives a page at true size

A4 is 210 × 297 mm and Letter is 215.9 × 279.4 mm. Pixels depend on the DPI you choose, 100, 150, 200 or 300: A4 at 150 DPI is 1240 × 1754 px.

Colour, grey or black and white

Colour keeps the photo, grey turns it into grey levels, and black and white applies a Sauvola threshold, which also cleans the background, with a window from 7 to 41 px and a strength k from 0.10 to 0.60.

Downloads PNG and PDF

The PDF is one page at the paper size. Measured corners keeps the proportion of a postcard, a note or a ticket: the page is as large as the image, the long side is capped at 3000 px, and 1 px is 1 pt.

Scanning without a scanner

Scanning a document without a scanner helps when there is a photo of the sheet but no scanner at hand.

  • A notebook page to PDF

    A page from a notebook or textbook becomes a clean A4 sheet for a PDF or for printing.

  • Documents for the archive

    A contract, receipt or invoice photographed on a table becomes a PDF at the paper size, and the local threshold keeps the text readable in uneven light.

  • Before text recognition

    The straightened page can be uploaded to a text recognition tool instead of the photo taken at an angle.

  • A sheet that is not A4

    A postcard, note or ticket keeps its proportion in Measured corners.

How the photo is straightened

A photo of a flat sheet taken at an angle is distorted in a predictable way, described by a 3 × 3 matrix called a homography. Four corners are exactly the data needed to find it.

  1. Four corners, eight equations

    Each corner gives one equation for x and one for y. The homography has eight unknowns because the ninth element is 1.

  2. Normalisation

    The points are shifted to centre on (0, 0) and scaled to an average distance of √2 (Hartley's normalised DLT, 1997). The 8 × 8 system is solved by Gaussian elimination with partial pivoting.

  3. Straightening back to front

    For each pixel of the page the inverse homography finds a point in the photo, and the colour comes from bilinear interpolation of four pixels. That leaves no holes. Outside the photo it is filled with white.

  4. Sauvola threshold

    For each pixel the mean and standard deviation are calculated in a window around it. The sums come from integral images, so the time does not depend on the window size.

The formulas in the tool's code
Applies toFormulaMeaning
Sauvola thresholdT = m·(1 + k·(s / R − 1))m is the window mean, s is the standard deviation, R = 128, k defaults to 0.34; below T is ink
Grey levelsgrey = 0.299·r + 0.587·g + 0.114·bthe BT.601 weights for the red, green and blue channels
Size in pixelspx = mm / 25.4 · DPIhow many pixels the page has at the chosen DPI
PDF page sizept = mm · 72 / 25.4A4 is 595.3 × 841.9 pt

What is different here

  • The corners are yours

    There is no automatic edge detection, so there is no guess that quietly skews the page.

  • The photo stays in the browser

    The straightening is solved in the tool's own code, with no computer vision library; the pdf-lib library only assembles the PDF file.

What it does not do

The tool does not find the corners itself, does not recognise text (OCR), does not process several pages at once and does not remove handwritten notes or stains. It does not correct brightness: a photo that is too dark is better retaken. The whole sheet has to be in the frame.

A4 and Letter come out in portrait orientation; for a landscape sheet use Measured corners. Without a reference in the frame (a ruler, a coin) the true size in mm cannot be known, so that mode gives a file in pixels, not for printing to scale. With a large photo and a high DPI the page may briefly stop responding.

Questions about scanning with a phone

How to scan a document with your phone?

Photograph the whole sheet, upload the photo, click its four corners and download the straightened page as a PNG or a PDF. A photo that is too dark is better retaken.

How do I make a photo look like a scanned document?

Click the four corners of the page: the tool straightens the perspective. The corners are manual because a wrongly detected one gives a page that looks straightened but is slightly skewed.

Can I print the scan at true size?

Yes, with A4 and Letter. The PDF page has the paper size and the image fills it completely. With Measured corners there is no physical size: 1 px is 1 pt.

Is the photo sent to a server?

No. Reading, straightening, converting to black and white and PDF assembly happen in the browser, and the tool's code has no request that sends the file.

What does the strength k do in black and white?

A larger k removes more of the background. It runs from 0.10 to 0.60 and defaults to 0.34, while the window runs from 7 to 41 px and defaults to 19.

Is it free?

Yes. Without an account it opens 3 times a day; a free account removes the limit.

The document scanner is free. Pro opens the rest

Pro costs 15 EUR a month and opens 45 Pro tools.

Scan your photo

Opens without an account 3 times a day. A free account removes the limit.