What DocLang is
Most document formats were designed for rendering. PDF describes where to draw pixels and HTML tells a browser how to lay out a page, but neither tells a language model what a document contains. Parsers that convert them for AI use end up guessing at reading order, flattening tables into strings, and dropping figures and metadata. DocLang is a constrained XML format built for LLM tokenizers, so each element maps to a single model token. Every element carries a semantic role, bounding box coordinates, and a position in the reading order, and tables keep their full grid structure. It is a specification rather than a product, so any parser can produce it and any tool can consume it. The working group was founded by IBM, NVIDIA, Red Hat, ABBYY, HumanSignal, and Forgis, and the specification is developed under Joint Development Foundation Projects as an LF AI & Data project.Why FineParser outputs it
Plain text is cheap to feed to a model because it throws structure away, while HTML and Markdown keep the structure but spend many tokens describing it. DocLang keeps the structure at a fraction of the cost. A table encoded with DocLang’s OTSL scheme needs five structural tokens where the equivalent HTML needs twenty-eight. DocLang also defines one canonical representation for each kind of content, so every tool that supports it produces the same output for the same document. Code written against FineParser’s output will work with any other DocLang producer, and your documents stay portable if you change parsers later.Example
The following DocLang fragment describes a heading and a small table, each with its bounding box on the page.<location> elements give the corners of the bounding box. Inside the table, <ched/> introduces a column header cell, <fcel/> introduces a data cell, and <nl/> ends the row.
Files
FineParser writes DocLang as a single.doclang file containing the markup. The DocLang specification also defines a .dclx archive, a ZIP package that bundles the markup with extracted images and other assets, but FineParser does not produce that form.
Learn more
The doclang.ai site has a project overview and an interactive viewer. The full specification and the reference toolkit live in the doclang-project repository on GitHub, which also provides thedoclang Python package for validating and packaging DocLang files.