An OCR (Optical Character Recognition) system reads the text in an image or a scanned PDF and turns it into text a computer can search and edit. A business OCR system goes one step further: it pulls out only the fields you need, such as the tax ID, date and total on a tax invoice, checks them, and sends them to your accounting system or a spreadsheet. This guide explains how OCR works, why Thai is harder than English, which Thai OCR tools exist, how to start building one in Python, and what it costs to run in a real company.
How an OCR system works
- Input: a scan, a phone photo or a PDF.
- Image clean-up: straighten, crop, remove noise and fix contrast.
- Text detection: find where the lines and words are.
- Text recognition: read the characters.
- Structuring: match text to fields, for example "invoice number" or "grand total".
- Validation and export: check the values and send them on.
Classic OCR only does steps 3 and 4, so you get the whole page as text. What is often called AI OCR, or IDP (Intelligent Document Processing), adds steps 5 and 6, so you get usable data instead of a wall of text.
Why Thai OCR is harder than English
- Stacked vowels and tone marks sit above and below the consonant. Miss one mark and the word changes.
- Look-alike letters such as ด/ค, ข/ช, บ/ป and ภ/ถ get confused as soon as the image is blurry.
- No spaces between words, which makes word segmentation and field matching harder.
- Thai digits (๐–๙) and Buddhist-era years (2569 for 2026) are mixed with Arabic digits and Gregorian years.
- Real documents carry stamps, signatures, handwriting and crooked scans.
The same engine can read an English letter almost perfectly and still struggle with a faded Thai tax invoice. Always test on your own documents rather than trusting an advertised accuracy figure.
Thai OCR tools: free vs paid
| Tool | Type | Cost | Good for |
|---|---|---|---|
| Tesseract (tha) | Open source, self-hosted | Free | Experiments, clean printed documents |
| EasyOCR | Open source Python library | Free | Quick prototypes |
| PaddleOCR | Open source toolkit | Free | Teams ready to tune or train models (test its Thai model on your documents first) |
| Typhoon OCR | Open-weight model for Thai and English documents | Free to run yourself (needs a GPU) | Structured Thai documents that must stay in-house |
| Google Cloud Vision / Document AI | Cloud API | Pay per page | High volume, fast start |
| Azure AI Document Intelligence | Cloud API | Pay per page | Companies already on Microsoft |
| Thai OCR API providers | Cloud API | Monthly or per-page plans | Ready-made templates for Thai documents |
Supported languages and prices of cloud services change often, so check each provider's documentation before you decide.
There is no single "best Thai OCR". It depends on the document types, image quality, monthly volume and whether data may leave your company. The method that works: shortlist two or three tools, run 50–100 of your real documents through them, and measure accuracy per field, not per character.
How far does free Thai OCR get you?
Free tools are fine for trials and low volumes, but the cost moves to developer time, servers (GPUs for the newer models) and maintenance. Free online OCR websites should never see documents with personal data, because the files are processed on someone else's server.
Building a Thai OCR system in Python: a starting point
This example uses Tesseract. Install Tesseract with the Thai language data (tha) first, then pip install opencv-python pytesseract.
import cv2
import pytesseract
image = cv2.imread("invoice.jpg")
gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
# Otsu thresholding separates the text from the background automatically.
binary = cv2.threshold(gray, 0, 255, cv2.THRESH_BINARY + cv2.THRESH_OTSU)[1]
text = pytesseract.image_to_string(binary, lang="tha+eng", config="--psm 6")
print(text)The output is still the whole page as text. The next step is pulling out fields and checking them. A Thai tax ID, for example, has 13 digits and the last one is a check digit, which catches most misreads:
def is_valid_thai_tax_id(value: str) -> bool:
# isdigit() and int() also accept Thai digits (๐–๙).
digits = [int(c) for c in value if c.isdigit()]
if len(digits) != 13:
return False
total = sum(d * w for d, w in zip(digits[:12], range(13, 1, -1)))
return (11 - total % 11) % 10 == digits[12]The full pipeline
- Collect real sample documents and group them by type.
- Clean the images: deskew, crop, denoise.
- Run OCR with layout detection for tables and line items.
- Extract fields with rules (patterns, positions) or a vision-language model.
- Validate automatically: tax ID check digit, subtotal plus VAT equals the total, dates in range.
- Send low-confidence fields to a review screen for a person to confirm.
- Export to Excel, Google Sheets or your accounting or ERP API.
- Track accuracy and the share of fields that needed review, and keep improving.
From prototype to production
- Confidence thresholds and human review. A good system never guesses: anything below the threshold goes to a person.
- PDPA. ID cards and bank statements contain personal data. Decide early whether processing happens on servers you control or with a cloud provider under a data processing agreement, delete files on a schedule and restrict access by role.
- Volume. Queue the work and process it in batches so a month-end spike doesn't stall the system.
- Integration. The value is in the data reaching your accounting system without retyping, so plan the export from day one.
How much does an OCR system cost?
| Option | Cost | Pros | Watch out for |
|---|---|---|---|
| Build it yourself with open source | No licence fees; developer time and servers | Full control | Weeks to months before accuracy is good enough |
| Pay-per-page OCR API | Grows with volume | Fast to start | Costs scale with volume; data leaves your company |
| Custom OCR system | With Vectorkub from 12,900 THB; 15,000–25,000 THB with a review screen and integrations | Built around your real documents and systems | You need to prepare sample documents |
See the full OCR system pricing.
Build it yourself or hire a team?
Build it yourself if you have a developer who can maintain models, one or two simple document types, and no deadline. Hire a team if you have many document types, personal data, an accounting or ERP system to connect, or simply need it working within weeks. Our Thai OCR implementation service starts by testing your real documents before any development begins.
FAQ
What is the difference between OCR and AI OCR?
OCR turns an image into text. AI OCR (or IDP) also understands the document's structure, extracts specific fields, and checks them, so the output is data your systems can use.
Can OCR read Thai handwriting?
Partly. Neat handwriting in form boxes is often readable; cursive handwriting is still unreliable, so those fields should go to a person for review.
Do PDFs always need OCR?
No. A PDF created by software already contains text that can be extracted directly. Only scanned or photographed PDFs need OCR.
Can ChatGPT or another LLM replace OCR?
Vision-language models have made field extraction much better, but important numbers should still be checked with rules, and you need to consider where the documents are sent.
How long does it take to build an OCR system?
A prototype with open-source tools takes days. A production system for one or two document types usually takes 2–4 weeks, and 4–6 weeks with a review screen and integrations.
