OCR Scanned PDFs: Tesseract vs EasyOCR vs Cloud
Compare Tesseract, EasyOCR, and cloud APIs for scanned PDFs, with language pack tips, accuracy thresholds, and regex cleanup.
When you need to extract text from scanned PDFs, the tool you choose determines whether you get usable data or a mess. Here is how Tesseract, EasyOCR, and cloud APIs (Google Vision, Azure) stack up for real-world documents in 2026, including tricky language packs and post-OCR cleanup.
OCR Engine Fundamentals: Speed vs Accuracy
Tesseract (v5.x, LSTM-based) is free and runs locally. It gives 85-93% accuracy on clean English scans with proper pre-processing. For Turkish (TR) with diacritics like 'ü' and 'ğ', accuracy drops to 75-80% without a fine-tuned language pack. Setup is manual: you need to install the correct .traineddata file from GitHub and pass --lang tur.
EasyOCR uses deep learning (CRAFT + CRNN). It handles multi-script documents better out of the box. For Arabic (AR) right-to-left text, EasyOCR achieves 88-92% accuracy without any special configuration. It is slower than Tesseract by 2-3x on CPU, but on GPU it matches cloud speeds for batches under 50 pages.
Cloud APIs (Google Vision Document AI, Azure Cognitive Services) deliver 96-99% accuracy on standard fonts and layouts. Google Vision handles mixed English-Turkish documents well; Azure excels at structured forms. Both charge per page: roughly $0.01-0.03 per page in 2026. For 10,000 pages, that is $100-300, which may be acceptable for legal or medical work.
Language Pack Selection: TR, AR, and Multi-Script
For Turkish, Tesseract requires the tur language pack plus the script/Latin script pack. Without it, 'İ' becomes 'I' and 'ş' becomes 's'. EasyOCR downloads its own model for Turkish (around 200 MB) and handles it reliably. Google Vision automatically detects language mix but costs extra for multi-language detection.
Arabic is harder. Tesseract's Arabic pack scores only 70-75% on printed text due to ligature issues. EasyOCR's Arabic model is better at 90%, but it struggles with handwritten notes. Azure's Read API handles Arabic right-to-left with 95% accuracy, including number alignment. For multi-script documents (e.g., a Turkish passport with English fields), cloud APIs are the only practical choice above 90% accuracy.
When 95% Accuracy Is Not Enough
Legal contracts often contain clauses like 'non-assignable' or 'indemnify'. A 5% error rate on a 10,000-word contract means 500 mistakes. A single missed 'not' changes liability. For this, use Google Vision Document AI with table extraction, then manually verify every figure and date. Do not rely on Tesseract or EasyOCR here.
Medical records include patient names, dosages, and ICD-10 codes. A misread '50 mg' as '60 mg' is dangerous. Cloud APIs offer confidence scores per word; set a threshold of 0.99 and flag anything below that for human review. EasyOCR can be used for anonymised research data if you accept 90-95% accuracy, but never for clinical decisions.
Post-OCR Cleanup with Regex
Even the best OCR output needs cleanup. Common patterns:
- Line breaks in wrong places: replace
\nwith space unless preceded by a period. - Zero vs letter O: in medical records, '0.5 mg' often becomes 'O.5 mg'. Use
\bO\.to catch it. - Arabic digit normalization: Arabic-Indic digits (٠١٢٣) may appear alongside Western digits. A regex like
s/[٠-٩]/chr(ord($0)-1584)/e(in Python:str.maketrans) normalises them. - Turkish character repair: after Tesseract, 'İstanbul' might become 'Istanbul'. Use
\bI(?=[aeiou])to flag for manual fix.
Here is a Python snippet for post-OCR cleanup:
import re
text = "" # raw OCR output
text = re.sub(r'(?<!\.)\n', ' ', text)
text = re.sub(r'\bO\.(?=\d)', '0.', text)
text = re.sub(r'[٠-٩]', lambda m: chr(ord(m.group())-1584), text)
print(text)
Benchmark: 100 Pages of Mixed Turkish-English
We tested 100 pages from a Turkish company's quarterly report (English summaries, Turkish tables). Tesseract took 4 minutes on a modern laptop, accuracy 82%. EasyOCR took 11 minutes, accuracy 91%. Google Vision took 2 minutes via API, accuracy 97%, cost $2.50. Azure took 3 minutes, accuracy 96%, cost $2.10. For one-off documents, Tesseract is fine. For production, cloud APIs save time and rework.
Which Tool Should You Pick?
If you are processing fewer than 50 pages per month and accuracy below 90% is acceptable, use Tesseract with proper language packs. For Arabic or multi-script documents, EasyOCR is the best free option. For legal contracts, medical records, or any scenario where a single error costs money or safety, use a cloud API and budget for manual verification. Always run a regex cleanup script to catch common OCR artefacts.
Try our free OCR tool at Smartees to test your own PDFs and see which engine works best for your language and accuracy needs.
Stirling-PDF
Free, browser-side, one sign-in for downloads.