Skip to content
AIRepoHub

docling

by docling-project

Tool for converting documents like PDFs and Word files into clean, structured data ready for AI.

Developer ToolsPythonMIT license
Stars
70,999
stars
Forks
5.4k
forks
Last push
today
Activity
Active
docling: quick start
# Install$ pip install docling# Convert a PDF to Markdown$ docling https://arxiv.org/pdf/2206.01062

Commands from the project's README. Run them after installing (see below).

Overview

Understand docling in 60 seconds

What it does
Docling converts documents such as PDF, Word, PowerPoint, Excel, HTML, e-books, emails and audio into clean, structured output like Markdown, HTML or JSON for AI applications. It understands PDF layout, reading order, tables, code and formulas.
The problem it solves
Feeding documents to AI models is hard when PDFs scramble reading order, tables and formulas. Docling parses documents properly, can run fully locally for sensitive data, and plugs into LangChain, LlamaIndex, CrewAI and Haystack.
Why choose it
Choose it for high-quality, local document parsing with a simple Python API and CLI. It started at IBM Research and is now hosted by the LF AI & Data Foundation.
Who should use it
  • Developers building RAG pipelines
  • Teams processing sensitive documents locally
  • Data engineers converting large document collections
  • Agent builders who need document tools (MCP)
Setup difficulty

You'll need:

  • Python 3.10+
  • macOS, Linux or Windows (x86_64 or arm64)

How docling works

Docling parses many formats, including PDF, DOCX, PPTX, XLSX, HTML, EPUB, Apple Pages, Numbers and Keynote, OpenDocument files, emails, calendar files, audio and video (with speech recognition), and XML schemas such as USPTO patents and JATS articles.

Its PDF understanding covers page layout, reading order, table structure, code, formulas and image classification, with OCR for scanned files and support for visual language models like GraniteDocling. Everything is represented as a unified DoclingDocument and can be exported to Markdown, HTML, DocTags or lossless JSON.

You can use it from Python with DocumentConverter, from the docling CLI, as an API service (docling-serve) or as an MCP server for agents. It can run fully locally for sensitive or air-gapped environments. Individual models used have their own licenses.

Features

Key features

Many formats

PDF, Office, HTML, EPUB, email, audio, video and more.

Advanced PDF parsing

Layout, reading order, tables, code and formulas.

OCR and VLMs

Scanned documents and GraniteDocling support.

Export options

Markdown, HTML, DocTags and lossless JSON.

AI integrations

LangChain, LlamaIndex, CrewAI and Haystack.

MCP and API server

Use it from agents or as a service.

Strengths

  • Excellent PDF structure handling
  • Runs locally
  • Broad format support
  • MIT licensed, backed by LF AI & Data

Limitations

  • Heavier dependencies than simple text extractors
  • Models have their own licenses
  • Large documents with OCR or VLMs can be slow on CPU

Practical use cases

RAG ingestion

Convert PDFs to Markdown before chunking and embedding.

Table extraction

Pull table structure out of reports.

Private document processing

Run locally on sensitive files.

Agent document tool

Connect the MCP server to your agent.

Installation

Install docling

Based on official documentation

Commands come from Docling's README. AIRepoHub hasn't run them yet. View source

Prerequisites

  • Python 3.10+

Supported systems

  • Windows
  • macOS
  • Linux
  1. 1

    Install

    Shell
    pip install docling
  2. 2

    Convert a document

    Writes a .md file to the current directory.

    Shell
    docling https://arxiv.org/pdf/2206.01062

Configuration and API keys

SettingWhat it's for

First run

  1. 1

    Convert with a visual language model

    Shell
    docling --vlm-model granite_docling https://arxiv.org/pdf/2206.01062

docling's documentation doesn't include sample output, so we don't show any. Expect the results in your terminal.

Your first project

Convert a PDF to Markdown in Python

Parse a research paper and print it as Markdown.

Before you start

  • Python 3.10+
  • pip install docling
  1. 1

    Run this script

    Text
    from docling.document_converter import DocumentConvertersource = "https://arxiv.org/pdf/2408.09869"converter = DocumentConverter()result = converter.convert(source)print(result.document.export_to_markdown())

What to expect

The Docling Technical Report printed as Markdown, starting with its title heading.

Next steps

  • Export to JSON for lossless structure
  • Try the LangChain or LlamaIndex integration
  • Run docling-serve as an API

Costs and requirements

What it costs to run

License
MIT for the codebase; models have their own licenses.Free
Software
Free and open source.Free
Compute
Runs on your machine.Free

Troubleshooting

Common setup issues

Install fails on Python 3.9

Docling dropped Python 3.9 in version 2.70.0; use Python 3.10 or higher.

Source: README.md

Scanned PDF gives little text

Docling has OCR support for scanned PDFs; see the usage docs to enable it.

Source: README.md

Need more options

See the installation and usage docs at docling-project.github.io/docling.

Source: README.md

Alternatives

Similar AI repositories