Back to All Blog Posts
Image Guides

How to Extract Text from Photos Accurately: OCR Tips That Work

By 6 min read
Extracting text from a photo with OCR
Short answer

Photograph the text straight on, in even light, as large and sharp as you can, then open it in Image to Text (OCR), choose the right language (add a second language for mixed text such as Urdu with English) and press Extract text. Drag over just the part you need for best results. Accuracy depends mostly on the image: tilt, blur, shadows and tiny text cause most errors.

OCR, optical character recognition, is the technology that reads text in an image and turns it into text you can copy, edit and search. When it works, it feels like magic: a photo of a notice board becomes an email in ten seconds. When it doesn’t, you get “Tbe rneeting wi11 be he1d” and spend longer fixing it than typing it.

The good news is that most OCR errors come from a handful of avoidable things in the photo itself. Fix those, and even a free, in-browser tool gives remarkably clean text.

How OCR reads an image

A simplified picture of what happens:

  1. The image is cleaned up and turned into black text on a white background (“binarised”).
  2. The engine finds blocks of text, then lines, then words.
  3. Each word is compared against what the engine has learned about that language’s letters and common words.

Every step can go wrong. Shadows break the black-and-white conversion. A tilted page makes lines run into each other. Tiny text doesn’t have enough pixels per letter to recognise. The wrong language setting makes the engine “correct” words into the wrong alphabet.

CleanPDF’s Image to Text uses the open-source Tesseract engine, running inside your browser, with extra clean-up before the image is read. The same principles apply to any OCR tool.

The photo matters more than the software

Shoot straight on

Hold the phone parallel to the page. Tesseract’s own documentation notes that line detection gets significantly worse when a page is skewed. A slight tilt is corrected automatically, but a steep angle squashes letters at the far edge.

Make the text big

Move closer, or crop to the part you need. OCR engines want plenty of pixels per letter; Tesseract’s documentation recommends the equivalent of at least 300 DPI. For a photo, that simply means the text should be large in the frame, not a small rectangle in the middle of a wide shot.

Light it evenly

Shadows from your hand or phone, and bright glare spots on glossy paper, are the biggest cause of missing words. Daylight from a window, without flash, works best.

Keep it sharp

Tap to focus on the text and hold still. A slightly blurred photo that looks readable to you can be hard work for OCR.

Avoid busy backgrounds

Text printed over photos, patterns or gradients is harder to separate. Choose the “Poster, sign, label” image type for that kind of image, so the engine looks for scattered text instead of a page.

Read only what you need. Drag a box over the paragraph, table cell or name you want. A smaller, focused area is read faster and more accurately than a whole cluttered page.

Step by step

  1. Open Image to Text (OCR) and choose the photo, take one with the camera, or paste a screenshot with Ctrl+V.
  2. Choose the language of the text.

    This matters more than people expect. If the text mixes two languages, for example Urdu with English words and numbers, add a second language.

  3. Pick the type of image if it isn’t a normal page: a screenshot, a poster or sign, or a single line such as a reference number. Leave automatic improvement switched on.
  4. Select the area you want, or use the whole image.
  5. Extract the text.

    Words read with high confidence are outlined in green; orange and red mean “please check”. Copy the text, download it as a .txt file or save a searchable PDF.

Getting good results from tricky images

ImageTypical problemWhat helps
ScreenshotsSmall text, dark modeChoose “Screenshot”; small text is enlarged and light-on-dark text inverted
ReceiptsFaint thermal print, curled paperFlatten the receipt and photograph it soon; faint print is darkened automatically
Two-column pagesLines from both columns mergedSelect one column at a time if the order comes out wrong
TablesCells run togetherUse “Original lines”, or select one column or cell at a time
HandwritingLow accuracyPrint-style handwriting works better than joined-up; expect to correct
Sideways photosText read as nonsenseRotation is detected automatically; rotate manually if needed

Urdu, Arabic and other scripts

OCR for Urdu, Arabic, Persian and other connected scripts is harder than for English, because letters change shape depending on their position in a word. A few things make a real difference:

  • Choose the exact language. Urdu and Arabic share letters but not vocabulary; the right language model gives noticeably better words.
  • Use a second language for mixed text. Many documents mix Urdu or Arabic with English words, dates and numbers.
  • Prefer printed text. Clean printed Naskh or Nastaliq text is recognised far better than handwriting or stylised calligraphy.
  • Give it big, sharp text. Connected scripts suffer most from blur and low resolution.

The tool supports 52 languages, including Urdu, Arabic, Hindi, Bengali, Punjabi, Persian and Pashto. Each language is downloaded once and then kept in your browser, so the second time starts immediately.

Check the result where it matters

Even good OCR makes a few mistakes, and some are hard to spot: 0 and O, 1 and l, rn and m. Always check names, numbers, amounts, dates and ID numbers against the image before using the text. The confidence colours tell you where to look first.

Scanned PDFs

If your text is in a scanned PDF rather than a photo, use PDF to Text (OCR), which reads every page. And if you are scanning paper yourself, a clean scan from Scan to PDF makes OCR much more accurate. Our guide to scanning documents with your phone covers how.

A note on privacy

People run OCR on exactly the documents they would least like to share: ID cards, bank letters, contracts and medical reports. Many free OCR websites upload the image to a server to read it. CleanPDF’s OCR runs in your browser, so the image and the text never leave your device.

Common mistakes

  • Leaving the language on English for Urdu, Arabic or any other language.
  • Shooting from an angle to avoid glare, and creating a skewed page instead.
  • Using a heavily compressed image, such as a photo forwarded several times on a messaging app.
  • Reading a whole cluttered page when you need one paragraph.
  • Trusting numbers without checking. One wrong digit in an account number matters.

Frequently asked questions

How can I extract text from a photo for free?

Open the photo in a free OCR tool such as CleanPDF’s Image to Text, choose the language of the text and press Extract text. You can copy the result, download it as a .txt file or save a searchable PDF.

Why is my OCR result full of mistakes?

Usually because of the photo: a tilted angle, shadows, blur, small text or a busy background. The wrong language setting is the other common cause.

Can OCR read Urdu and Arabic?

Yes. Choose Urdu or Arabic as the language, and add English as a second language for mixed text. Printed text gives much better results than handwriting or calligraphy.

Can OCR read handwriting?

Neat, print-style handwriting can be read with moderate accuracy, but joined-up handwriting gives many errors. Expect to correct the result.

What resolution is best for OCR?

The equivalent of at least 300 DPI, according to the Tesseract documentation. For phone photos, make the text large in the frame and keep it sharp.

Is it safe to use online OCR for documents?

It depends on whether the image is uploaded. CleanPDF’s OCR runs in your browser, so the image isn’t sent to a server.

Extract text from your image

52 languages including Urdu and Arabic, automatic clean-up and searchable PDF output, all in your browser.

Open Image to Text
Akhtar Ali

Runs CleanPDF and builds its browser-based PDF, image and QR tools. Writes the site’s guides on everyday document problems.