How scans know which way is up: orientation detection
· How it works
Humans orient a page in a glance: text lines run left-right, headers sit on top. Teaching software that glance turned out to be a perfect job for a small neural network — and much more reliable than the old metadata guesswork.
The old way and its failure mode
Cameras store an EXIF orientation flag (“how the phone was held”), and software used to trust it. But the flag describes the camera, not the document — photograph a sideways card with an upright phone and the flag says “fine!” while the content lies on its side. Different apps honouring flags differently made it worse.
The new way: look at the page
After cropping, ToPDF hands the page to a compact classifier trained on millions of document images to answer one question: is this 0°, 90°, 180° or 270° from upright? It reads the statistical fingerprint of text layout the way you do. The correction is applied before first render — you never see the sideways version at all — and it runs per page, so mixed-orientation documents come out right page by page.
Human override, respected
Text-light pages (photos, diagrams) can genuinely stump the classifier — so the Rotate button always wins: once you set a page's rotation manually, automation stops second-guessing that page, even through later re-crops. Automation for the 98%, your judgment for the rest. (The edge cases.)
Frequently asked questions
Why classify only four angles — what about a 30° tilt?
Small tilts are perspective, handled by the corner-based correction. Orientation is the separate, discrete question of which edge is “up” — four answers cover it.
Does it read the text to decide?
No reading — it recognises visual layout patterns (line direction, mass distribution). It’s fast precisely because it understands nothing about the words.
Scan it now — free & private
Snap a photo, get a clean auto-cropped PDF in seconds. Everything runs in your browser — your documents never leave your device.
Open the scanner