Docling is an open-source document conversion toolkit, originally developed at IBM Research and released under the MIT license, that turns PDFs, office files, HTML and scanned images into a structured, machine-readable representation. In Document AI, it belongs to the family of PDF parsing and document-to-Markdown conversion tools, combining layout analysis, table structure recognition, reading order detection and optional OCR in one local pipeline.
The project became widely used because it runs entirely on local hardware, produces a rich document model rather than flat text, and integrates directly with retrieval-augmented generation frameworks. It is now hosted as a community project under the Linux Foundation’s AI and data umbrella, which signals vendor-neutral governance.
How the Docling pipeline processes a document
Docling processes a document in a sequence of specialized stages rather than with one monolithic model. For PDFs, a parser first extracts the programmatic text cells and their coordinates, then each page is rendered as an image for visual models that recover structure the raw file does not encode.
A layout analysis model, trained on the DocLayNet dataset of human-annotated pages, detects regions such as titles, paragraphs, lists, tables, figures, captions, page headers and footnotes. A separate table structure model, known as TableFormer, reconstructs rows, columns and spanning cells. Assembly logic then applies reading order and merges everything into a unified document object.
The table below summarizes the main stages and what each contributes.
| Stage | Function | Output |
|---|---|---|
| PDF backend | Reads text cells, fonts and coordinates | Positioned text tokens |
| Layout model | Classifies page regions | Labeled bounding boxes |
| Table structure model | Recovers grid and cell spans | Structured table objects |
| OCR engine (optional) | Reads text from scanned regions | Recognized text with positions |
| Enrichment models (optional) | Formulas, code, picture classification | Additional semantic annotations |
| Assembly | Reading order and hierarchy | A unified DoclingDocument |
Input formats and output representations
Docling accepts many input formats through dedicated backends, and all of them converge on one internal model called the DoclingDocument. This shared representation stores text items, tables, pictures, groups and their provenance, meaning page number and bounding box, so downstream code does not depend on the source format.
| Category | Supported examples | Notes |
|---|---|---|
| Paged documents | PDF, scanned images such as PNG and TIFF | Full visual pipeline applies |
| Office formats | DOCX, PPTX, XLSX | Structure read from the file markup |
| Web and markup | HTML, Markdown, AsciiDoc | No rendering or layout model needed |
| Export formats | Markdown, HTML, JSON, DocTags | JSON preserves the full document model |
Lossless JSON export matters for production systems: it keeps coordinates and element types that a Markdown export discards. Teams therefore often store JSON as the canonical artifact and derive Markdown only for language model prompts.
Docling compared with related tools
Docling sits between classic OCR engines and end-to-end vision-language parsers. It uses specialized models for each subtask, which makes its behavior more predictable and its compute cost lower than sending every page to a large multimodal model.
| Tool or approach | Core method | Strength | Limitation |
|---|---|---|---|
| Docling | Modular layout, table and OCR models | Local, structured, open license | Weaker on unusual layouts outside training data |
| Tesseract | Line-level OCR | Mature, many languages | No layout or table semantics |
| Nougat | End-to-end transformer to markup | Strong on scientific formulas | Slower, prone to repetition errors |
| LlamaParse | Hosted parsing service | Little setup, model-assisted | Data leaves the organization |
| LLM-based extraction | Vision-language model per page | Flexible on complex pages | Higher cost and possible hallucination |
The project also offers a vision-language pipeline that uses compact models, such as SmolDocling and its successors, to emit the DocTags markup directly from page images. This option is useful for difficult pages but changes the speed and accuracy profile, so it should be evaluated separately.
Using Docling in retrieval and AI pipelines
The most common use of Docling is preparing documents for retrieval-augmented generation. Clean structure improves retrieval quality because chunks can follow section boundaries, tables stay intact and each chunk can carry its heading path as context.
Docling includes structure-aware chunkers, including a hybrid chunker that respects document hierarchy and a token limit at the same time. Integrations exist for popular orchestration frameworks such as LangChain, LlamaIndex and Haystack, and a command-line tool converts folders in batch.
| Setting | Recommended when | Trade-off |
|---|---|---|
| OCR disabled | Born-digital PDFs with embedded text | Much faster, misses text inside images |
| OCR enabled | Scans, faxes, photographed pages | Slower, accuracy depends on scan quality |
| Accurate table mode | Financial or technical tables | Higher latency per table |
| GPU acceleration | Large batch conversions | Hardware cost, but far higher throughput |
Limitations and practical cautions
Docling is reliable on typical business and scientific documents, but no layout model generalizes perfectly. Accuracy drops on dense multi-column newspapers, heavily decorated brochures, handwritten forms and tables without ruling lines.
- CPU-only throughput can be a bottleneck for millions of pages; plan capacity and consider GPUs.
- OCR quality limits the result on poor scans; Docling does not repair image defects such as heavy skew or blur on its own.
- Docling converts, it does not extract fields: invoice totals or contract clauses still require key information extraction on top.
- Version changes alter output: model updates can shift chunk boundaries, so pin versions and rerun evaluations after upgrades.
A sound practice is to build a small evaluation set of 50 to 100 representative pages, with expected headings, tables and reading order, and to measure conversion quality on it before rollout. Teams that skip this step often discover silent errors, such as a merged table column or a footnote placed mid-paragraph, only after users report wrong answers from the downstream assistant.
Stripped to the essentials
Docling is a free tool that reads documents the way a careful person would. It looks at a PDF page and sees titles, paragraphs, tables and pictures. It then writes them out in a clean, organized digital form.
Many AI systems need text they can understand. A raw PDF often mixes columns, headers and table cells into a jumble. Docling sorts that out. It turns messy files into tidy text and tables that a computer can search and an AI assistant can answer questions about. It runs on your own computer, so the files stay with you.
Where it is applied
An engineering firm wants an internal assistant that answers questions from about 40,000 technical manuals, most of them born-digital PDFs with many specification tables. A small platform team runs Docling on two GPU servers, disables OCR for digital files and enables it only for roughly 3,000 scanned legacy manuals.
The team stores the JSON output as the master copy and uses the hybrid chunker to create chunks of about 500 tokens that keep each table whole and carry its section title. In a test of 200 real engineer questions, answers citing the correct table rise noticeably compared with the earlier plain-text extraction. The firm also keeps all documents on its own servers, which satisfies its confidentiality rules for client designs.