Inferensys

Glossary

ALTO XML

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.
Stylish WeWork-like workspace with hot desks and document wall, professional searching through enterprise knowledge base on a mounted ultrawide display, warm industrial pendants overhead.
ANALYZED LAYOUT AND TEXT OBJECT

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.

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.

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.

DIGITAL PRESERVATION STANDARD

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.

01

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.

XML Schema 4.4
Current Version
02

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.
Word-Level
Granularity
03

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.
04

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.

05

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.
06

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.
ALTO XML

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.

OCR OUTPUT FORMAT COMPARISON

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.

FeatureALTO XMLHOCRPAGE 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)

Prasad Kumkar

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.