How to Get Accurate Text From a Photo or Screenshot
Written by the MicroTools Hub team · Updated
Optical character recognition, or OCR, finds the text in a picture and turns it into characters you can select, edit and search. It works well on clean printed text and badly on almost everything else, so most of the quality is decided before you press the button. This guide explains what OCR does, how to prepare an image, and how to check the result.
Related tools: Image to Text (OCR), Word Counter. They run in your browser, with no account.
What OCR does, and what it does not
An OCR engine looks for lines of text in the picture, cuts each line into letters and compares their shapes with what it learned for a language. It does not understand what the words mean, and it cannot tell that a letter it read is wrong because it makes no sense in the sentence.
That is why OCR is good at printed text in common fonts and poor at handwriting, decorative lettering, text on busy photographs and complicated layouts. It gives you plain text, not a rebuilt document, so tables, columns and formatting are not kept.
Prepare the image first
- Use a screenshot where you can. Its letters are exact and straight, which is the easiest input of all.
- For a page of a book or notes, photograph it straight on, in even light, with the text filling most of the frame. Avoid shadows across the lines and glare from a lamp or window.
- Make the letters large enough. In our tests on clean screenshots, capital letters about 10 pixels tall still read correctly, while letters about 6 pixels tall did not until the image was enlarged. Photos need more margin than screenshots, so take a closer photo instead of relying on enlarging a small one.
- Crop away borders, pictures and anything that is not text. Extra material can be read as stray characters.
- Make sure the picture is upright. A page that is only a little crooked is fine, but a sideways or upside-down page reads as nonsense or as nothing until you rotate it.
Choose the language and settings
Pick the language the text is written in. A wrong language produces wrong letters even from a perfect image, and a picture that mixes two languages will not read well in either.
Two settings are worth knowing. Enlarging a very small image before reading helps when letters are only a few pixels tall, and on our own test images it turned a mostly wrong result into an almost right one. The tool does this by itself for tiny images; forcing it on larger images can make results worse. The shadows setting makes the engine judge dark and light locally, which helps a photo with one dark side, but it can make faint or noisy images worse, so leave it off unless shadows are the problem.
Check the result against the picture
Treat the output as a first draft. Read it next to the image and correct it before you use it in an essay, a form or anything else that matters. The usual slips are:
- Digits and letters swapped: the number 0 for the letter O, and 1 for a lowercase l or a capital I.
- Two letters read as one: the letters rn read as m, or the reverse.
- Missing or wrong accents, quotation marks and small punctuation such as commas and full stops.
- Lines in the wrong order when a page has columns, and words broken across lines.
Example: A screenshot of the line “Total spent: $10.89 plus £2.40.” should come back word for word. If you see “Total spent: S10.89”, the dollar sign has been read as a capital S: fix it by hand, then check every figure the same way.
When nothing useful comes back
- Rotate the image in 90 degree steps and read it again.
- Use a sharper or larger version, or crop closer to the text.
- Check that the language matches, and try the shadows setting for a photo with uneven light.
- For handwriting, retyping is usually faster than correcting a bad reading.
- A PDF is not an image: if your document is a scanned PDF, save or export the pages as JPG or PNG pictures first.
Keep private pages private
Many OCR sites upload your picture to a server. The MicroTools Hub tool reads it inside your browser instead, so the picture and the text stay on your device. You can check this yourself: open your browser's developer tools, look at the network tab while you read an image, and you will see only the engine files being downloaded from this site, not your picture.
Once you have the text, paste it into the word counter to check its length, and read it against the original before you submit it anywhere.
Further reading
This guide is general information for study purposes. Check your institution's own requirements, which take priority.