Prompt
I'm building a document parser and want OCR with tables and coordinates
Latest observation
Oct 11, 2026
OpenAI APIWeb search: off
For OCR with tables and coordinates, you’ll want a system that returns:
- Recognized text
- Bounding boxes / coordinates for each word, line, or block
- Table structure detection
- Ideally page-level layout information too
Good options
1) Cloud OCR APIs
Best if you want strong accuracy and less engineering.
-
AWS Textract
- OCR + tables + forms
- Returns coordinates for words/lines/tables/cells
- Good for invoices, forms, scanned docs
-
Google Document AI
- Strong layout and table extraction
- Returns bounding boxes, tables, paragraphs, tokens
- Good for general document parsing
-
Azure Document Intelligence (Form Recognizer)
- OCR + tables + key-value pairs
- Gives polygons/coordinates for elements
- Good enterprise option
2) Open-source stack
Best if you need self-hosting or customization.
-
PaddleOCR
- Strong OCR
- Can return text boxes and confidence
- Often paired with layout/table models
-
Tesseract
- Basic OCR with box coordinates
- Weaker on complex layouts and tables
-
LayoutParser + Detectron2 models
- Useful for layout detection
- Can identify tables, headers, paragraphs, etc.
-
Table Transformer / PubTables-1M models
- Good for table structure extraction
- Often used with OCR output
Recommended approach
If your priority is tables + coordinates + production readiness, I’d suggest:
- AWS Textract if your docs are mostly forms/invoices and you want simplicity
- Google Document AI if you need rich layout/table structure
- Azure Document Intelligence if you’re already in Microsoft ecosystem
If you want open-source:
- Use PaddleOCR for OCR
- Use a table detection/structure model for table layout
- Merge OCR boxes with detected table cells
Data you should expect
A good OCR parser should output something like:
{
"page": 1,
"text": "Item Qty Price",
"blocks": [
{
"type": "table",
"bbox": [100, 200, 500, 600],
"cells": [
{"row": 1, "col": 1, "text": "Item", "bbox": [110, 210, 180, 240]},
{"row": 1, "col": 2, "text": "Qty", "bbox": [190, 210, 250, 240]}
]
}
]
}
If you want to build it yourself
A practical pipeline is:
-
Preprocess image/PDF
- deskew
- denoise
- enhance contrast
-
Detect layout
- text blocks
- tables
- figures
-
Run OCR
- get words + boxes
-
Table reconstruction
- assign OCR tokens to table cells
- infer rows/columns from grid lines or spatial alignment
-
Export structured JSON
- page, block, line, word, bbox, table cells
Quick recommendation
- Need fastest path: Textract / Document AI
- Need self-hosted: PaddleOCR + table detection model
- Need just OCR boxes: Tesseract or PaddleOCR
- Need strong table extraction: Document AI or Textract
If you want, I can also give you:
- a Python example
- a comparison table of OCR tools
- a full JSON schema for OCR + tables + coordinates