Prompt
I'm trying to parse scanned forms and the OCR quality is bad
Latest observation
Nov 10, 2026
OpenAI APIWeb search: off
Bad OCR on scanned forms is usually a document quality + preprocessing + OCR engine/tuning problem. A good pipeline is:
- Fix the image first
- Use OCR suited for forms
- Post-process and validate with form structure
1) Improve the scan/image
If the source is poor, OCR will struggle no matter what.
- Target resolution: 300 DPI minimum, 400+ DPI if possible
- Deskew: straighten tilted pages
- Denoise: remove speckles / fax noise
- Increase contrast: especially for faint text
- Binarize carefully: thresholding can help, but sometimes hurts if text is light
- Crop margins / black borders
- Remove background artifacts: shadows, bleed-through, gridlines if they interfere
- Deblur if possible: mild sharpening only; aggressive sharpening creates artifacts
2) Use the right OCR approach for forms
Forms are not plain text pages.
Options:
- Tesseract: decent baseline, but can be weak on messy scans
- EasyOCR / PaddleOCR: often better on real-world scans
- Cloud OCR:
- Google Document AI / Vision
- Azure Form Recognizer / Document Intelligence
- AWS Textract
These are often much better for structured forms because they detect:
- text
- boxes
- tables
- key-value fields
- layout
3) Tune OCR for forms
If you use Tesseract or similar:
- Use the right page segmentation mode (PSM):
psm 6for a block of textpsm 11for sparse textpsm 4for columns
- Try different OCR engines / languages
- Restrict character sets for known fields:
- digits only
- uppercase only
- date patterns
- OCR each field separately instead of the whole page when possible
4) Exploit form layout
For scanned forms, the best strategy is often:
- Detect the form template
- Locate each field region
- OCR only the field region
- Use rules to validate the result
Example:
- date field → expected format
MM/DD/YYYY - ID field → numeric only
- checkbox → detect filled vs empty, not OCR
5) Use post-processing
After OCR:
- Spell-correct against a domain dictionary
- Normalize common OCR confusions:
O↔0I↔1S↔5B↔8
- Use regex validation for dates, phone numbers, IDs
- Compare against known context if available
6) If forms are fixed-layout, use template matching
If all forms come from the same template:
- Register the scanned page to a reference template
- Map field coordinates
- OCR each field area separately This often gives a big accuracy boost.
7) If OCR is very bad, consider training / fine-tuning
If your forms are consistent and OCR keeps failing:
- Train a custom OCR model
- Or use a model trained on your document type
- Some tools support custom extractors for specific forms
Practical recommendation
If you want the fastest improvement:
- Scan at 300+ DPI
- Deskew + denoise + contrast normalize
- Use PaddleOCR or Google/Azure/AWS form OCR
- Extract fields by coordinates/template
- Add regex + dictionary validation
If you want, I can help you build a Python preprocessing + OCR pipeline for scanned forms, or suggest the best OCR tool depending on whether your forms are fixed-layout or variable-layout.