---
title: "7 open-source tools that turn PDFs into LLM-ready text"
slug: "open-source-ocr"
description: "Seven open-source tools that turn PDFs, scans and Office files into clean Markdown and JSON for LLM pipelines — OCR included."
published: "2026-11-11"
verifiedAt: "2026-11-11"
picks: 7
canonical: "https://aifree.dev/best/open-source-ocr"
---

# 7 open-source tools that turn PDFs into LLM-ready text

> Seven open-source tools that turn PDFs, scans and Office files into clean Markdown and JSON for LLM pipelines — OCR included.

Published 2026-11-11. Last checked 2026-11-11.

Copy-paste from a PDF gives you broken columns, lost tables and missing text, and your LLM inherits the mess. These seven open-source tools turn PDFs, scans and Office files into clean Markdown and JSON instead.

Every pick is open source (one AGPL, two with extra license terms, all flagged), pushed a commit in the last 90 days (checked 2026-11-11), and installable from its own docs. Ordered as a pipeline: quick dumps first, deep parsing next, raw OCR engines last.

## The 7 tools at a glance

| Tool | What it does | Price | Install |
| --- | --- | --- | --- |
| MarkItDown | Any file → Markdown for the chat context | Free · OSS (MIT) | `pip install "markitdown[all]"` |
| PyMuPDF | Fast CPU-only PDF → Markdown, no GPU | Free · AGPL-3.0 | `pip install --upgrade pymupdf` |
| Docling | Deep parsing: layout, tables, formulas, charts | Free · OSS (MIT) | `pip install docling` |
| marker | High-accuracy PDF → Markdown + JSON | Free · Apache-2.0 code | `pip install marker-pdf` |
| MinerU | Complex docs → Markdown/JSON for agents | Free · Apache-2.0 + terms | `uv pip install mineru` |
| PaddleOCR | Multilingual OCR engine, 100+ languages | Free · OSS (Apache-2.0) | `pip install paddleocr` |
| Tesseract | The classic OCR engine, 100+ languages | Free · OSS (Apache-2.0) | `brew install tesseract` |

## 1. MarkItDown: everything into the context window

[MarkItDown](https://github.com/microsoft/markitdown) is Microsoft's lightweight Python utility that converts files to Markdown for LLMs: PDF, PowerPoint, Word, Excel, HTML, EPubs, ZIP archives, CSV/JSON/XML, even YouTube URLs and audio transcription.

**What:** One `convert()` call per file — built for feeding chat context, not for pixel-perfect human documents.

**Why:** One dependency covers most office formats and keeps headings, lists, tables and links.

**Use when:** You want a document's content in the conversation in seconds.

**Install:**

```bash
pip install "markitdown[all]"
```

**Catch:** Image captioning and speech transcription rely on web-hosted services — not everything stays on your machine.

## 2. PyMuPDF: CPU-only speed, no GPU

[PyMuPDF](https://github.com/pymupdf/PyMuPDF) is a PDF library that now outputs LLM-ready Markdown and JSON itself (`doc.to_markdown()`), without a GPU. It is the fast route when you have thousands of text PDFs.

**What:** A Python library with Markdown output and table extraction built in.

**Why:** No accelerator needed: it parses text PDFs fast on a plain CPU.

**Use when:** Batch-converting digital-born PDFs where speed beats layout intelligence.

**Install:**

```bash
pip install --upgrade pymupdf
```

**Catch:** AGPL-3.0: closed-source products need Artifex's commercial license instead.

## 3. Docling: the deep reader

[Docling](https://github.com/docling-project/docling) is a document-parsing toolkit started at IBM. It reads page layout, reading order, table structure, code and formulas, and turns bar and pie charts into tables.

**What:** A CLI and Python API that plug into LlamaIndex and LangChain pipelines.

**Why:** It reads structure — which cells belong to which table, what order paragraphs go in — not just text.

**Use when:** RAG quality matters more than raw speed.

**Install:**

```bash
pip install docling
```

**Catch:** It runs layout and table models locally, so it is slower than plain text extractors, and the first run downloads weights.

## 4. marker: accuracy-first PDF to Markdown

[marker](https://github.com/VikParuchuri/marker) converts PDFs to Markdown and JSON with layout models, and can call an LLM to fix tables and math.

**What:** A pip package and CLI for demanding, mixed-layout documents.

**Why:** On olmocr-bench, a third-party test of 1,403 PDFs, its README reports 76.0%, ahead of MinerU and Docling.

**Use when:** Extraction quality is the product, and you can live with model-weight terms.

**Install:**

```bash
pip install marker-pdf
```

**Catch:** The code is Apache-2.0, but the model weights use a modified OpenRAIL-M license — free for research, personal use, and startups under $5M funding or revenue.

## 5. MinerU: complex documents, agent-ready

[MinerU](https://github.com/opendatalab/MinerU) turns complex PDFs and Office files into LLM-ready Markdown and JSON. It also ships a skill, so coding agents such as Claude Code can run it for you.

**What:** A converter tuned for hard layouts: scientific papers, multi-column text, formulas and tables.

**Why:** Where simple extractors lose the structure, MinerU keeps it.

**Use when:** Your documents are the messy kind — papers, reports, filings.

**Install:**

```bash
pip install uv
uv pip install -U "mineru>=4.0,<5"
```

**Catch:** Apache-2.0 with extra terms: online services must credit MinerU, and a commercial license is required above 100 million monthly active users or USD 20 million monthly revenue.

## 6. PaddleOCR: the multilingual engine

[PaddleOCR](https://github.com/PaddlePaddle/PaddleOCR) is a full OCR (text recognition from images) toolkit for 100+ languages, with Markdown and JSON output. Its small PaddleOCR-VL-1.6 model scores 96.3% on the OmniDocBench v1.6 benchmark.

![PaddleOCR PP-StructureV3 demo: a low-quality Chinese scan with formulas converted into Markdown with rendered LaTeX](https://f.aifree.dev/media/best/open-source-ocr/7592732cc1077af9.webp#w=1280&h=719)

**What:** OCR plus document parsing that recovers text, formulas and tables from scans into structured output.

**Why:** The widest language coverage on this list, with top benchmark scores on formulas and tables.

**Use when:** The scans are ugly, multilingual, or formula-heavy.

**Install:**

```bash
pip install paddleocr
```

**Catch:** It runs on Baidu's PaddlePaddle framework, not PyTorch, so expect a second deep-learning stack.

## 7. Tesseract: the classic that runs everywhere

[Tesseract](https://github.com/tesseract-ocr/tesseract) is the classic open-source OCR engine. It reads more than 100 languages out of the box and has pre-built packages for every major OS.

**What:** A battle-tested OCR engine you can call from the CLI, C++ API, or wrappers in every language.

**Why:** Every major package manager has it, and it needs no GPU or Python.

**Use when:** You need plain text from images inside your own tooling.

**Install:**

```bash
brew install tesseract
```

**Catch:** Outputs plain text, hOCR, PDF, TSV or ALTO, but no Markdown or table structure, so LLM use needs post-processing.

## Which one to try first

Want one file in the chat right now → #1. Thousands of digital PDFs on a CPU box → #2. Structure-aware RAG pipeline → #3. Best Markdown quality → #4. Messy scientific layouts, or driving it from Claude itself → #5. Ugly multilingual scans → #6. Text from images inside your own scripts → #7.

## Picks

1. [MarkItDown](https://github.com/microsoft/markitdown)
2. [PyMuPDF](https://github.com/pymupdf/PyMuPDF)
3. [Docling](https://github.com/docling-project/docling)
4. [marker](https://github.com/VikParuchuri/marker)
5. [MinerU](https://github.com/opendatalab/MinerU)
6. [PaddleOCR](https://github.com/PaddlePaddle/PaddleOCR)
7. [Tesseract](https://github.com/tesseract-ocr/tesseract)

## Frequently asked questions

### What is the best open-source PDF to Markdown tool?

For complex layouts, marker and MinerU are the usual picks; PyMuPDF is the fastest CPU-only route; Docling is best when you need LlamaIndex or LangChain integration. Accuracy varies by document type, so test on your own files.

### Is open-source OCR really free?

Yes for most uses. Tesseract, PaddleOCR, Docling and MarkItDown are permissively licensed with no revenue caps. marker's model weights are free only for research, personal use and startups under $5M, MinerU needs a commercial license above 100M monthly active users or $20M monthly revenue, and PyMuPDF is AGPL unless you buy its commercial license.

### Can Claude read PDFs directly, or do I need OCR?

Digital PDFs with a text layer can be attached directly. Scans and image-only PDFs need OCR first — run one of these tools, get Markdown or JSON, and feed that to the model for far better results than raw pixels.

## Sources

- https://github.com/microsoft/markitdown
- https://github.com/pymupdf/PyMuPDF
- https://github.com/docling-project/docling
- https://github.com/VikParuchuri/marker
- https://github.com/opendatalab/MinerU
- https://github.com/PaddlePaddle/PaddleOCR
- https://github.com/tesseract-ocr/tesseract
- https://tesseract-ocr.github.io/tessdoc/Installation.html
- https://themenonlab.blog/blog/best-open-source-pdf-to-markdown-tools-2026
- https://roboflow.com/blog/best-open-source-ocr-models

HTML page: https://aifree.dev/best/open-source-ocr
