What is OCR and how does it work?
Updated September 23, 2026
OCR, short for optical character recognition, is software that reads the letters in a picture and turns them into text a computer can search, copy and edit. It is what makes a scanned contract searchable or lets you pull a paragraph out of a photographed page. This guide explains the process, what determines accuracy and where OCR still fails.
The problem OCR solves
A computer sees a scanned page as a grid of coloured dots. It has no idea that a cluster of dark pixels is the letter e, so there is nothing to search, select or copy. The same happens with a phone photo of a receipt, a screenshot or a PDF made from scans.
OCR closes that gap. It looks at the pixels, decides which characters they form and returns real text. Once text exists, everything you expect from a digital document becomes possible: search, copy, translation, indexing and conversion to Word or plain text.
How OCR works, step by step
Modern OCR engines follow a similar pipeline. The exact methods differ between engines, but the stages are recognizable.
- Preparation: the image is converted to black and white or grayscale, cleaned of specks and sometimes straightened if the page is slightly skewed.
- Layout analysis: the engine finds blocks of text, lines and words, and works out the reading order.
- Recognition: each line is compared with what the engine has learned about the shapes of the chosen language. Tesseract, the open-source engine used by our OCR tool, uses a neural network for this stage.
- Language checking: the candidate words are checked against language knowledge, which helps choose between similar-looking options.
- Output: the recognized text is returned, either as a text file or as a hidden layer aligned with the original image.
What decides the accuracy
The image matters most. A sharp scan at 300 DPI, straight, with dark text on a light background, can be recognized very well. Blurry photos, shadows, low resolution, faded ink, coloured backgrounds and busy patterns behind the text all lower accuracy.
The second factor is the language setting. The engine needs to know which alphabet to expect. Choosing English for a French document, for example, produces wrong or missing accented letters. The third factor is the typeface: clean printed fonts are easy, decorative fonts and very small print are harder.
Typical mistakes and what they look like
OCR rarely fails completely; it makes small, predictable errors. The digit 0 and the letter O, the digit 1, the lowercase l and the capital I, or the pair rn read as m are the classic ones. Stray marks on the paper turn into odd punctuation.
This is why numbers, codes and names deserve a second look, particularly in invoices, contracts and identification numbers. For anything where one wrong digit matters, compare the text with the original image instead of trusting it blindly.
Handwriting, tables and scripts
OCR works best on printed text. Handwriting is not reliably recognized, and cursive is much harder than neat block capitals. Tables, columns and forms can also confuse the reading order, because the engine sees text blocks rather than the logic of the table.
Scripts matter too. Arabic is joined and written right to left, so it is harder than plain Latin text. In our OCR PDF tool, Arabic and Russian are recognized, but you receive the result as a .txt file rather than as a searchable PDF layer. For Latin-script languages, the tool can produce a searchable PDF as well.
What OCR produces
There are two common outputs. Plain text is just the recognized words in a .txt file, useful when you want to reuse the content. A searchable PDF keeps the original page image and adds an invisible text layer, so the document looks unchanged but can be searched and copied.
OCR PDF can produce either or both, in English, French, Spanish, Arabic, German, Italian, Portuguese, Dutch, Turkish and Russian. It runs in your browser with Tesseract.js, and your documents are not uploaded. The OCR engine and language data are downloaded once from a public CDN the first time you use it, and recognition takes seconds per page.
OCR compared with related tools
OCR is needed only when a page has no text. If your PDF was exported from Word or another program, it already contains text, and PDF to Text or PDF to Word can read it directly. Running OCR on such a file only adds work, which is why OCR PDF can skip pages that already have text.
Think of OCR as the first step for scanned files. Recognize the pages, then choose the format you actually need: a searchable PDF for archiving, a text file for reuse, or an editable Word document for changes.
Frequently asked questions
What does OCR stand for?
OCR stands for optical character recognition. It is the technology that converts images of printed or typed text into machine-readable text that you can search, copy and edit.
Is OCR 100 percent accurate?
No. Accuracy depends on the scan quality, the language setting and the font. Clean, sharp, straight printed pages are recognized very well, while blurry images, small print and handwriting produce errors, so check important numbers and names.
Can OCR read handwriting?
Not reliably. Printed text works well, but handwriting varies so much between people that results are often poor, especially for cursive. Neat block letters do better than joined writing.
Does OCR upload my document to a server?
Not with OCR PDF. Recognition runs in your browser using WebAssembly, so the documents are never uploaded. Only the OCR engine and the language files are fetched once from a public CDN.
Tools mentioned in this guide
More guides
- How to make a scanned PDF searchableTurn a scanned PDF into a searchable one with OCR: how to check if your file needs it, language and DPI settings, what to expect, and how to verify the result.
- How to scan documents to PDFTurn paper into a clean PDF with a phone camera or scanner: lighting and framing tips, page order, the document filter, file size, and adding searchable text.