PDF Basics

What Is OCR? A Complete Guide to Optical Character Recognition

What OCR is, how to tell whether a scanned PDF needs it, what improves accuracy for Arabic and mixed-language documents, and what to check by hand afterwards.

What Is OCR? A Complete Guide to Optical Character Recognition

You open a scanned contract, try to copy a clause, and nothing gets highlighted. You press Ctrl+F to find a name you can clearly see on the page, and the reader says "no results". The file isn't broken: to your computer, that page is a picture of text, not text. OCR is the technology that turns that picture back into characters a computer can search and copy.

This guide explains what OCR does, how to tell whether your PDF needs it, what makes results good or bad (with special attention to Arabic), and what to check by hand afterwards. One thing up front: SmokePDF does not currently offer an OCR tool. We explain below what our tools can and cannot do around scanned files, so you know where to go for each step.

Quick answer

OCR (Optical Character Recognition) reads the shapes of letters in an image and converts them into real text. You need it when a PDF is only scanned images: you can't select words, Ctrl+F finds nothing, and PDF to Text returns empty pages. For good results, scan at around 300 DPI, keep pages straight and high-contrast, choose the right language (Arabic, English, or both), and always check numbers, names and dates by hand. SmokePDF has no OCR tool; use the OCR feature in a desktop PDF editor, a scanning app, or an open-source engine such as Tesseract.

What OCR is and what it produces

OCR stands for Optical Character Recognition. The input is an image: a scanned page, a phone photo, a screenshot. The output is text encoded as characters, the same way a document typed in Word stores its letters. Once text exists in that form, you can search it, copy it, or let a screen reader read it aloud.

OCR software usually gives you one of two results:

How it works, briefly

Most OCR engines go through roughly the same stages. First, they clean up the image: straightening a tilted page, removing specks, and turning the page into sharp black and white. Next, they analyze the layout to find text blocks, columns, and table cells, and separate them from photos and logos. Then comes recognition itself, where modern engines use trained models that look at whole words or lines rather than isolated letters. Finally, a language model corrects unlikely results using a dictionary and context, for example preferring "invoice" over "irvoice".

That last step is why the language setting matters: an engine set to English alone will produce nonsense or nothing on Arabic pages.

Text-layer PDF or image-only PDF: how to tell

A PDF exported from Word, Google Docs, or an accounting system contains a real text layer. Each character is stored with its code and position, so no OCR is needed. A PDF produced by a scanner, a photocopier, or a phone camera usually contains only images of pages.

Three quick tests tell you which one you have:

  1. Try to select text. Drag your cursor over a line. If individual words get highlighted, there is a text layer. If the whole page gets selected as a single block, or nothing happens, it's an image.
  2. Use Ctrl+F (Cmd+F on a Mac). Search for a word you can see on the page. No results on a word that is clearly there means an image-only page.
  3. Run it through PDF to Text. The tool extracts whatever text layer exists. On a scanned file you will see the page markers ("--- Page 1 ---", "--- Page 2 ---") with nothing underneath them. That empty output is a reliable sign the file needs OCR.
CheckPDF with a text layerImage-only (scanned) PDF
Selecting with the cursorIndividual words highlightWhole page selects, or nothing
Ctrl+F searchFinds visible wordsNo results
PDF to Text outputReadable textPage markers with empty content
Zooming in farLetters stay sharpLetters become blurry or pixelated
Needs OCR?NoYes

One trap: a file can have a text layer that is wrong. Some old PDFs have Arabic text that copies out as reversed or disconnected letters, or as strange symbols, because of how the fonts were embedded. In that case the problem isn't missing text but a broken encoding, and running OCR on the page images can actually give cleaner text than the existing layer.

What affects OCR accuracy

OCR quality depends mostly on the image you give it. The same engine can produce clean text from one scan and garbage from another copy of the same page.

Why Arabic is harder for OCR

Arabic OCR has improved a lot, but it still tends to make more errors than Latin-script OCR on scans of the same quality. Knowing why helps you anticipate them.

Connected letters

Arabic letters join together, and most letters change shape depending on whether they come at the start, middle, or end of a word, or stand alone. The engine can't simply cut the line into separate characters as it would with printed English. A slightly blurry join can make two letters look like one, or one like two.

Dots

Many Arabic letters share the same base shape and differ only by the number and position of dots: ب ت ث ن ي, or ج ح خ, or ر ز, or س ش. A speck of dust can add a dot, and a faded scan can remove one. That is enough to turn one word into another real word, which is exactly the kind of error a spell-checker won't catch.

Diacritics (tashkeel)

Most everyday documents are written without full vowel marks, which is actually easier for OCR. Fully vowelled text, such as Quranic quotations, poetry, or children's books, adds many small marks above and below the line. Engines may drop or misplace them, so expect more review.

Mixed right-to-left and left-to-right text

Arabic documents often contain numbers, Latin names, email addresses, product codes, or whole French paragraphs. The OCR output then has to keep the correct reading order. Common symptoms of trouble: numbers with their digits reversed, a French phrase dropped into the middle of the wrong Arabic sentence, or parentheses flipped.

Fonts and digits

Naskh-style printed fonts are recognized much better than Ruq'ah, Diwani, or decorative headline fonts. Also check the digits: some documents use Western digits (1, 2, 3) and others Eastern Arabic digits (١, ٢, ٣). Make sure the engine is reading the ones your document actually contains.

How to get better OCR results

Most improvements happen before you press the OCR button.

  1. Scan rather than photograph when you can. A flatbed scanner gives even lighting and a flat page. If you only have a phone, use a scanning app that crops and flattens the page, or follow the photo tips in our guide to turning phone photos into a PDF: daylight, no flash, phone parallel to the page.
  2. Set the scanner to 300 DPI, in grayscale or black-and-white text mode. Color rarely helps recognition; keep it only if stamps or signatures must show in the archived copy.
  3. Straighten and orient pages first. Pages that are sideways or upside down confuse many engines. You can fix orientation with Rotate PDF before running OCR.
  4. Remove pages that don't need recognition. Blank pages and separator sheets only add junk characters. Extract Pages lets you keep just the pages you need.
  5. Select the right languages. Arabic only for Arabic text; Arabic plus French or English for mixed documents. Selecting extra languages you don't need can make results worse.
  6. Run OCR on the best copy you have. Don't compress a scan heavily before OCR. Compress afterwards if you need a smaller file.
  7. Test on one or two pages. Before processing a 100-page file, try the hardest page (a table, small print, or a stamp) and compare settings.

When to review the result manually

OCR output always needs a human check when errors would matter. Give extra attention to:

A practical routine: keep the original scan open next to the recognized text, and check every number and proper name, not just a sample. If you made a searchable PDF, search for a few words you know are on each page to confirm the hidden layer actually exists and matches.

Privacy: cloud OCR versus local OCR

The documents people most often need to OCR are also the most sensitive: contracts, bank statements, medical reports, ID copies. So it's worth knowing where the processing happens.

Before uploading anything, ask yourself whether you would be comfortable emailing the same file to a stranger. If not, prefer a local option. For background on why in-browser and on-device processing keeps files private, see how browser-based PDF processing works.

What SmokePDF can and cannot do with scanned PDFs

To be clear: SmokePDF does not have an OCR tool at the moment. None of our tools will turn a scanned page into searchable or editable text. Here is what they do around OCR, all running in your browser without uploading the file:

Frequently asked questions

Does OCR change how my scanned document looks?

Not if you produce a searchable PDF. The original page image stays exactly as it was, and the recognized text sits invisibly behind it. Some tools also offer to clean or deskew the image itself; turn that off if you need the visual copy unchanged.

Can OCR read handwriting?

Standard OCR is designed for printed text, and results on handwriting are usually poor. Some specialized tools handle neat handwriting reasonably, but forms filled by hand almost always need manual review or retyping.

Why does my OCR'd Arabic text paste in the wrong order?

This usually comes from how the target application handles right-to-left text, especially when Arabic is mixed with numbers or Latin words. Try pasting into an editor with proper RTL support and setting the paragraph direction to right-to-left before assuming the recognition itself is wrong.

Will OCR make my file bigger?

A searchable PDF adds a text layer, which is small compared with the page images, so the size increase is usually modest. Large files are almost always large because of the scanned images themselves, not the text.

Is it worth running OCR on a PDF that already has text?

Generally no, since the existing text is exact and OCR can only introduce errors. The exception is an older PDF whose text layer copies out as garbled or reversed Arabic; there, OCR on the page images may give you usable text.

The bottom line

OCR turns pictures of text into real text, and the quality of the result depends mostly on the quality of the scan: about 300 DPI, straight pages, good contrast, and the correct languages. Arabic adds its own challenges with joined letters, dots, diacritics, and mixed directions, so always check numbers, names, and dates against the original. Use a local OCR tool for sensitive documents, and remember that SmokePDF does not perform OCR. Its tools help you test whether a file has text, prepare pages, and reduce file size, but the recognition step has to happen in OCR-capable software.

Abdelilah Barbach

Abdelilah Barbach

Founder & Technical Content Editor

Abdelilah Barbach is the founder of SmokePDF and builds its browser-based PDF tools. He writes practical guides on compressing, converting, merging and protecting PDF files, based on how the site's own tools work and on testing them with real documents. He writes in Arabic and English.