Skip to content
LeedyBox
Support

How to Extract Text From Images With OCR

OCR (optical character recognition) turns the letters in a photo, screenshot or scan into text you can copy and edit. This guide explains what affects the result and how to get cleaner text.

How OCR Works

An OCR engine first converts the image to black and white so that letters stand out from the background. It then analyses the layout, finding blocks of text, lines and words. Finally, a recognition model estimates which characters each word shows.

The LeedyBox tool uses Tesseract, an open-source OCR engine, through Tesseract.js. Its recognition model is a neural network trained on printed text, with separate data for each language. The engine also reports a confidence value for each word, and the tool shows their average for each image.

Choosing the Language

The language setting tells the engine which characters and words to expect. Reading Korean, Japanese or Russian text with the English model produces nonsense made of Latin look-alike letters, and for languages that share an alphabet, the right model handles accents and common words better.

If an image mixes two languages, for example a Korean document with English product names, choose both. Add a second language only when the text needs it: each extra language makes recognition slower and gives the engine more characters to confuse.

Image Language Text layout
Document page or article in one language That language Automatic
Menu, slide or label with local text and English words Local language + English Automatic
Cropped paragraph whose lines come out in the wrong order That language A single block of text
One line, such as a heading, a serial number or a sign That language A single line of text

Image Quality Tips

  • Resolution: small text in a low-resolution image is the most common cause of errors. Enlarging helps somewhat, which is why the LeedyBox tool can read small images again at twice the size, but it cannot restore detail the image does not contain. Very large letters can also be read less reliably.
  • Contrast: dark text on a plain light background works best. Faint print, grey text, coloured backgrounds and shadows make it harder to separate the letters. The greyscale and contrast option can help with faint text, but compare the results, because it can also make a clean image worse.
  • Straight text: tilted, curved or perspective-distorted text, such as a book photographed at an angle, leads to merged lines and wrong characters. Rotate or retake the image if the text is clearly skewed.
  • Cropping: crop the image to the text you need. Logos, photos, borders and neighbouring columns can be mistaken for characters and can confuse the reading order.
  • Compression: heavy JPG compression blurs letters with artefacts. Save screenshots as PNG where you can; see JPG, PNG, WebP and AVIF.

Screenshots vs Photos

Screenshots are sharp and straight, so they usually give good results. Their main weakness is size: interface text is often only a few pixels high. Zoom in on the page or app before taking the screenshot, and do not scale the screenshot down afterwards. You can paste a screenshot straight into the tool with Ctrl+V (⌘+V on a Mac).

Photos add uneven light, glare, blur, perspective and curved pages. Hold the camera parallel to the page, fill the frame with the text, use even light without flash glare, and tap to focus. The orientation recorded by the camera is applied before reading, so a photo taken with the phone held sideways is read the right way up.

For PDF files, use PDF to Text instead of converting pages to images: it reads the existing text layer and runs OCR only on pages without one. The guide Extracting Text From PDFs: Text Layers and OCR covers scanned PDFs.

Handwriting and Stylised Fonts

The models used here are trained on printed text, so handwriting is usually recognised poorly. Neat, separated block capitals have the best chance; joined-up writing and signatures rarely come out usable. Decorative, script or very condensed fonts, text on patterned backgrounds and vertical text cause similar problems.

Checking and Correcting the Result

Treat OCR output as a draft. Typical mistakes include confusing 0 and O, 1, l and I, or "rn" and "m"; dropped or wrong accents and punctuation; words merged or split at line ends; and lines from neighbouring columns mixed together. Tables and multi-column layouts are not preserved: the result is plain text.

Compare the text with the image, paying particular attention to numbers, names, dates, amounts and addresses, where a single wrong character matters. A high confidence value does not prove the text is correct. You can edit the text in the tool before copying or downloading it.

Privacy: What Stays on Your Device

The LeedyBox tool runs the OCR engine in your browser: your images are read on your device and are not uploaded to LeedyBox. The browser downloads the Tesseract.js library, its WebAssembly engine and the data for each language you choose from leedybox.com itself. These are ordinary file downloads that do not include your images. Tesseract.js stores the language data in your browser's storage (IndexedDB) so that it does not have to be downloaded again; clearing the site data in your browser removes it.

Frequently Asked Questions

Why is the first image slow?

The first time you use a language, the OCR engine and the language data (several megabytes) are downloaded. Later images reuse them, and the language data is kept in your browser's storage for later visits.

Can OCR keep the layout of a document?

The tool extracts plain text with line breaks. Columns, tables, fonts and formatting have to be rebuilt by hand in your editor.

Why did the tool find no text at all?

Usually the text is too small or faint, or the language is wrong. Crop to the text, check the language, or try another text layout setting.