ALTO XML (Analyzed Layout and Text Object) is a standardized XML Schema that encodes the spatial layout and recognized text content of a single digitized page. It serves as a post-OCR metadata container, storing the precise bounding box coordinates for every word, text block, and illustration alongside the machine-generated text and associated confidence scores.
Glossary
ALTO XML

What is ALTO XML?
ALTO XML is an open XML Schema maintained by the Library of Congress used to describe the layout and OCR information for text blocks, illustrations, and page elements of digitized content.
This schema is a critical component in legal document structure parsing pipelines, acting as the bridge between raw pixel data and structured legal XML. By preserving the geometric hierarchy of a page, ALTO enables downstream tasks like zonal OCR, reading order detection, and table extraction, ensuring that the spatial context of a contract or statute is not lost during digitization.
Key Features of ALTO XML
ALTO (Analyzed Layout and Text Object) is an open XML Schema maintained by the Library of Congress that encodes the layout and OCR information of digitized content, serving as a critical bridge between raw document images and machine-readable text.
Layout and Content Separation
ALTO XML enforces a strict separation between physical layout and logical content. The schema describes the precise spatial coordinates of text blocks, illustrations, and marginalia on a page without imposing any semantic interpretation. This allows a single ALTO file to serve as a neutral ground-truth layer for multiple downstream processing pipelines—legal document structure parsing, historical manuscript analysis, or newspaper digitization—each applying its own semantic overlay. The file records bounding box polygons for every recognized element, preserving the exact typographic geography of the original document.
Granular Text Block Representation
ALTO decomposes a page into a hierarchy of nested elements: PrintSpace, TextBlock, TextLine, and String. Each String element represents a single recognized word and carries attributes for:
- CONTENT: The OCR-recognized text
- WC: Word confidence score (0.0–1.0)
- HPOS/VPOS: Horizontal and vertical position in pixels
- WIDTH/HEIGHT: Dimensions of the bounding box
- STYLEREFS: Pointer to font style definitions This granularity enables downstream token classification and named entity recognition systems to operate with precise spatial context.
Font and Style Metadata
ALTO captures detailed typographic metadata through TextStyle and ParagraphStyle elements referenced by text blocks. Attributes include:
- FONTFAMILY: Typeface name (e.g., Times New Roman)
- FONTTYPE: Classification (serif, sans-serif, monospace)
- FONTSIZE: Point size
- FONTSTYLE: Bold, italics, underline This metadata is essential for font-based heuristic parsing, where changes in font weight or size signal structural transitions—such as a bold 14pt heading followed by 11pt body text—enabling accurate header hierarchy extraction without semantic analysis.
Hyphenation and Reading Order
ALTO provides explicit mechanisms for handling end-of-line hyphenation and logical reading order. The SUBS_TYPE attribute on a hyphenated word fragment indicates whether it is the first part (HypPart1) or second part (HypPart2) of a broken word, enabling accurate text reconstruction. The ID and IDREF attributes link related text blocks, while the optional ReadingOrder element defines the intended sequence of text regions—critical for multi-column legal documents where naive top-to-bottom extraction would scramble the content.
Illustration and Non-Text Regions
Beyond text, ALTO defines Illustration and GraphicalElement blocks for non-textual content. Each illustration carries:
- TYPE: Classification (map, photograph, drawing, chart)
- FILEID: Reference to an external image file
- POSITION: Bounding polygon coordinates This structured metadata enables zonal OCR pipelines to selectively ignore marginal illustrations, stamps, or seals while focusing processing on text-bearing regions. For legal documents, this is vital when extracting operative text from scanned contracts that contain logos, signature blocks, or notary seals.
Integration with METS/XML Frameworks
ALTO is designed to function within the METS (Metadata Encoding and Transmission Standard) ecosystem. A METS file acts as a wrapper, referencing:
- Descriptive metadata (Dublin Core, MODS)
- Administrative metadata (provenance, rights)
- File sections pointing to TIFF/JPEG page images
- Structural map linking ALTO files to their corresponding images This integration allows legal digitization projects to maintain a complete preservation package where the raw scan, OCR output, and structural metadata remain permanently linked—essential for maintaining chain of custody and citation integrity in legal AI systems.
Frequently Asked Questions
Clear, technical answers to common questions about the ALTO XML standard for digitized content layout and OCR metadata.
ALTO (Analyzed Layout and Text Object) XML is an open XML Schema maintained by the Library of Congress that describes the layout and OCR information for text blocks, illustrations, and page elements of digitized content. It works by storing the precise spatial coordinates of every recognized word, text line, and block on a scanned page, along with associated metadata like confidence scores and font styles. Unlike full-text formats, ALTO XML does not encode the logical reading order or semantic structure of a document; it focuses exclusively on the physical layout. This makes it a critical companion to structural metadata standards like METS (Metadata Encoding and Transmission Standard), where ALTO files are typically referenced as the content layer beneath a structural map. The schema defines elements such as <TextBlock>, <TextLine>, and <String> to hierarchically represent the page's visual composition, enabling downstream applications to reconstruct the original appearance or extract text with positional awareness.
ALTO XML vs. HOCR vs. PAGE XML
A technical comparison of the three dominant open standards for encoding the layout, content, and metadata of digitized documents.
| Feature | ALTO XML | HOCR | PAGE XML |
|---|---|---|---|
Maintaining Organization | Library of Congress | Internet Archive / Community | PRImA Research Lab (Univ. of Salford) |
Primary Schema Basis | Standalone XML Schema (XSD) | HTML Microformat (classes on <span>/<div>) | Standalone XML Schema (XSD) |
Core Purpose | Layout and metadata for a single page | Embedding OCR in the visual context of a page | Comprehensive ground truth and annotation |
Granularity of Text Representation | Block, Line, String (word) | Block, Paragraph, Line, Word | Region, TextLine, Word, Glyph |
Glyph-Level Coordinates | |||
Native Confidence Scores | Word level (WC attribute) | Word level (x_wconf property) | Word and Glyph level |
Reading Order Representation | Implied by sequence; explicit via String IDREFs | Implied by DOM sequence | Explicit ReadingOrder group element |
Arbitrary Region Types | Limited (TextBlock, Illustration, etc.) | Limited (ocr_par, ocr_carea, etc.) | Extensible via custom region types |
Multi-Layer Annotation Support | |||
ISO Standard | ISO 24619:2011 (PREdictable Units) | ISO 24612-2 (Linguistic Annotation Framework) |
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Related Terms
Understanding ALTO XML requires familiarity with the broader ecosystem of document structure parsing, layout analysis, and OCR standards. These related terms form the technical foundation for building robust legal document processing pipelines.
Reading Order Detection
The algorithmic determination of the logical sequence in which text blocks, columns, and inset elements should be read. ALTO XML represents reading order through the ReadingOrder element, which groups OrderedGroup and UnorderedGroup references to block IDs. This is critical for legal documents where multi-column layouts, footnotes, and marginal citations create ambiguous visual paths. Graph-based approaches model text blocks as nodes with spatial relationship edges, then apply topological sorting to resolve the correct narrative flow.
Zonal OCR
A technique where optical character recognition is applied only to user-defined regions of a document, ignoring irrelevant areas like headers, footers, or marginalia. ALTO XML's Processing element records which zones were included or excluded during recognition. In legal document pipelines, zonal OCR enables:
- Selective extraction of operative provisions while skipping boilerplate
- Targeted re-OCR of low-confidence regions without reprocessing entire pages
- Privacy compliance by excluding personally identifiable information zones from recognition
PDF Structural Extraction
The process of reconstructing logical document structure—paragraphs, headings, lists, reading order—from the unstructured stream of drawing commands in a PDF file. Unlike born-digital ALTO XML, PDFs store content as absolute-positioned glyphs with no inherent semantic hierarchy. Extraction pipelines must:
- Cluster spatially proximate glyphs into words and lines
- Detect font size/weight changes to infer heading boundaries
- Reconstruct table structures from ruling lines and cell alignments
- Output structured formats like ALTO XML for downstream legal NLP tasks
BIO Tagging Scheme
A token-level annotation standard used in sequence labeling where tokens are tagged as Beginning, Inside, or Outside of a named entity or structural chunk. When training models to generate ALTO XML from raw text, BIO tagging identifies:
- B-HEADING: First token of a section title
- I-HEADING: Continuation tokens of the same title
- O: Body text tokens
This scheme enables token classification models (e.g., BERT-based architectures) to predict document structure boundaries that map directly to ALTO's
TextBlockandStringelements.

About the author
Prasad Kumkar
CEO & MD, Inference Systems
Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.
His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us