How to Extract Text From an Image (OCR) — A Practical Guide
OCR — optical character recognition — converts the pixels of letters into actual characters you can copy, search and edit. It is remarkably good on clean input and unreliable on messy input. Here is how to stay on the good side of that line.
What OCR handles well
- Screenshots of documents, code, chat logs and web pages.
- Scanned pages at 300 DPI or higher.
- Printed signs, receipts, invoices and forms.
- Clear, high-contrast text in a common font.
What it struggles with
- Handwriting — accuracy drops sharply, especially cursive.
- Tiny text — below roughly 12 px of text height, letters blur together.
- Low contrast — grey text on a grey background, or a photo of a screen with glare.
- Rotation and skew — more than a few degrees starts to confuse line detection.
- Decorative fonts — scripts, heavy stylisation, or very tight letter spacing.
- Complex layouts — multi-column pages and tables often come out in the wrong reading order.
How to get better results
- Start with the highest-resolution version you have. Do not OCR a compressed thumbnail if the original exists.
- Straighten it. If the page is rotated or skewed, fix that first.
- Increase contrast. A scan at 300 DPI in black and white beats a colour photo every time.
- Crop to the text. Borders, backgrounds and other objects add noise.
- Enlarge small text. If the text is under 12 px tall, upscaling 2–3× before recognition often helps.
- Proofread numbers. OCR commonly confuses 0/O, 1/l/I, 5/S and 8/B. Any figure you will act on deserves a manual check.
A note on file formats
OCR engines read pixels, not file extensions. PNG is the safest input for screenshots because it has no compression artefacts around letter edges; a heavily compressed JPG can smear small glyphs and cost you accuracy. If you have a JPG, use the highest quality version available.
Privacy: why run OCR in the browser?
The images people want to OCR are often the most sensitive ones: passports, bank statements, contracts, medical letters, payslips. Uploading those to a free online OCR service means trusting a stranger's server with them — and you usually have no way to know how long they keep the file.
Running the recognition locally avoids the question entirely. The engine downloads once, the image stays in memory, and the text appears on your screen. Nothing is transmitted, nothing is stored.
When text cannot be selected in a PDF
A "flat" PDF is just pictures of pages — there is no text layer to copy. OCR is the fix: convert the pages to images, recognise them, and you have selectable text. For a born-digital PDF, on the other hand, you do not need OCR at all — the text is already in the file and can be extracted directly.
Try it now: Image to Text · Compress Image