Choose the simplest output that preserves the next task
Choose the simplest format that preserves every property the next task needs. Plain text is not a substitute for coordinates, and a searchable PDF is not a structured dataset.
You should be able to state which document properties the next task requires and reject any output format that discards necessary coordinates, page identity, layout, provenance, or editability.
Apply the decision with PDF to Text. Then test the tradeoff against Multi-Column OCR and Reading Order Review and Searchable PDF vs Plain Text: Choose the Right OCR Output.
Output format decision
| Format | Keeps layout | Best use |
|---|---|---|
| TXT | No | Reading, editing, simple search |
| JSON or TSV | If schema includes it | Validation and data pipelines |
| hOCR | Word and line boxes | Web-compatible OCR layout exchange |
| ALTO XML | Detailed page regions | Library and archive workflows |
| Searchable PDF | Visual page plus text layer | Search with source appearance |
Write the output requirements before selecting a format
List what the next system needs: plain characters, page boundaries, word coordinates, confidence, reading order, table structure, the original page image, or correction history. A format that omits a required property cannot be repaired reliably after the source relationship is lost.
TXT is simple and portable. TSV or JSON can retain fields and coordinates when their schema is documented. hOCR and ALTO represent layout differently and require consumers that understand those structures. A searchable PDF keeps the visual page but its hidden text still needs alignment and sequence testing. Choose the least complex format that preserves every required property.
- Name required properties
- Confirm the consumer supports the format
- Retain provenance and page identity
Compare text, coordinates, layout, and provenance
Use TXT for human-readable text
Plain text is portable and easy to edit, search, and diff. It usually loses coordinates, confidence, font information, table relationships, and the exact visual source.
Use JSON or TSV for pipelines
A documented schema can carry page, line, word, confidence, and bounding boxes. JSON is flexible; TSV is simple for tabular processing. Neither has one universal OCR schema, so include a version and field definitions.
Use hOCR or ALTO for layout
hOCR embeds OCR properties in HTML, while ALTO is a standardized XML representation for layout and content. Both can support page reconstruction, but consumers need to understand coordinate units and reading-order conventions.
Use searchable PDF for visual reference
A searchable PDF keeps the page image with a text layer. It helps search and selection but needs separate accessibility structure and may conceal misaligned or incorrect text behind an unchanged image.
Output-format requirements
- List required downstream properties
- Keep page and source identifiers
- Document schema and coordinate units
- Store engine and processing settings
- Retain the original image separately
Format names do not guarantee content quality
Two files with the same extension may preserve very different coordinates, hierarchy, confidence, and provenance. Inspect the actual schema and exported reading order.
How to use specifications and examples
Specifications define possible structures, while sample files reveal what an engine actually emits. Validate version, units, coordinate origin, encoding, and omitted fields before integration.

