cd /news/ai-tools/docling-turn-messy-documents-into-cl… · home topics ai-tools article
[ARTICLE · art-134792] src=dev.to ↗ pub= topic=ai-tools verified=true sentiment=↑ positive

Docling: Turn Messy Documents into Clean Data for Your AI App

Docling, an open-source Python library started by IBM Research Zurich and now hosted by the LF AI & Data Foundation, converts PDFs, Office files, images, and even audio into structured Markdown, HTML, or JSON for LLM and RAG pipelines. The MIT-licensed tool detects layout and reading order, rebuilds tables, and recognizes code blocks, formulas, and images, exporting everything through a unified DoclingDocument format. It offers integrations with LangChain, LlamaIndex, CrewAI, and Haystack, plus an MCP server and a docling-serve API, and runs fully locally for sensitive or air-gapped environments.

by read2 min views1 publishedSep 19, 2026

If you've built anything with LLMs, you've hit this wall: your data lives in PDFs, Word files, slide decks, and scanned images. You need clean text to feed a model or a RAG pipeline. Basic PDF-to-text tools give you a jumbled mess: tables collapse into random lines, two-column layouts get read in the wrong order, and headers mix with body text.

Docling is an open-source Python library built to solve exactly that.

Docling reads documents and converts them into structured output such as Markdown, HTML, or JSON. It was started by IBM Research Zurich, is now hosted by the LF AI & Data Foundation, and is MIT licensed. It has over 66k stars on GitHub, so it's far from a side project.

What sets it apart from a plain text extractor is that it tries to understand the page. It detects layout and reading order, rebuilds tables, and recognizes code blocks, formulas, and images.

Input formats include PDF, DOCX, PPTX, XLSX, HTML, EPUB, images, LaTeX, email files, and even audio and video (transcribed with speech recognition models). Scanned PDFs are handled with OCR.

Everything is converted into one internal format called DoclingDocument, which you can then export as Markdown, HTML, or lossless JSON. That means your downstream code deals with one structure no matter what the input was.

You need Python 3.10 or newer.

pip install docling

Convert a document from the command line:

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

This writes a .md file to your current directory.

Or use it from Python:

from docling.document_converter import DocumentConverter

converter = DocumentConverter()
result = converter.convert("https://arxiv.org/pdf/2408.09869")
print(result.document.export_to_markdown())

That's it. Local file paths work the same way as URLs.

Docling has ready-made integrations with LangChain, LlamaIndex, CrewAI, and Haystack, so you can drop it into an existing RAG pipeline as the document . It also ships an MCP server for connecting it to AI agents, and an API server (docling-serve) if you'd rather run it as a service than import it as a library.

It runs fully locally, which matters if you're handling sensitive documents or working in an air-gapped environment. No data has to leave your machine.

Yes, if any of these describe you:

A few honest caveats. Docling uses machine learning models for layout and table detection, so the install is heavier than a lightweight library like pypdf, and models are downloaded on first run. Processing large PDF batches on CPU can be slow, and a GPU helps a lot. If all you need is raw text from simple, single-column PDFs, a lighter tool will do the job with less overhead.

── more in #ai-tools 4 stories · sorted by recency
── more on @docling 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/docling-turn-messy-d…] indexed:0 read:2min 2026-09-19 ·