Repolode
datalab-to

datalab-to/marker

Converts PDFs and other documents to markdown, JSON, chunks, or HTML, with optional LLM assistance for higher accuracy.

Open-source alternative to:Adobe AcrobatABBYY FineReader

Stars
40,554
Forks
2,934
Open issues
494
Last commit
yesterday

What is it?

Marker is a document conversion tool that turns PDFs, images, PPTX, DOCX, XLSX, HTML and EPUB files into markdown, JSON, chunks or HTML. It handles tables, forms, equations, inline math, links, code blocks and images, and strips headers, footers and other page artifacts from the output.

It offers two modes: a balanced mode that uses a vision-language model for layout and OCR on GPUs, and a fast mode aimed at CPUs that relies mainly on the PDF text layer and only calls the model where needed. A pure text-layer mode with no model calls is also available. Output can be customized with processors and renderers, and a block-tree JSON format allows programmatic access to individual elements.

With the --use_llm flag, Gemini, Claude, OpenAI-compatible endpoints, Azure, Vertex, OpenRouter or Ollama can be used to improve tables, math and forms. The project also provides a CLI, a Python API, a FastAPI server, and a Streamlit app.

Key features

  • 01Converts PDF, image, Office and EPUB files to markdown, JSON, chunks or HTML
  • 02Reconstructs tables, forms, equations and inline math
  • 03Extracts and saves images from documents
  • 04Removes headers, footers and other page artifacts
  • 05Optional LLM pass for higher accuracy, with custom prompts
  • 06Runs on GPU, CPU or Apple MPS, with a CPU-only fast mode

Use cases

  • Preparing PDF research papers or textbooks as markdown for RAG pipelines
  • Converting scanned or digital forms and tables into structured data
  • Batch-converting a folder of documents while keeping images and JSON structure
  • Building custom post-processing steps with its processor and renderer interfaces

Quick start

  1. 1

    Install PyTorch from the official site for your platform

  2. 2

    Install marker with pip (Python 3.10+)

    pip install marker-pdf
  3. 3

    Convert a PDF to markdown

    marker_single /path/to/file.pdf

Things to know

  • Accurate OCR needs a local inference server: Docker with the NVIDIA Container Toolkit on NVIDIA GPUs, or llama.cpp on CPU and Apple Silicon.
  • The model weights use a modified OpenRAIL-M license, which is not free for commercial use beyond startup limits; the code is Apache 2.0.
  • The LLM-assisted hybrid mode needs an external LLM service configured by you.

Topics

FAQ

What is marker?
Converts PDFs and other documents to markdown, JSON, chunks, or HTML, with optional LLM assistance for higher accuracy. Marker is a document conversion tool that turns PDFs, images, PPTX, DOCX, XLSX, HTML and EPUB files into markdown, JSON, chunks or HTML. It handles tables, forms, equations, inline math, links, code blocks and images, and strips headers, footers and other page artifacts from the output.
Is marker free to use? What license does it have?
marker is open source under the Apache-2.0 license. Check the license terms before using it in commercial products.
Is marker still maintained?
Actively maintained. The last commit to marker was on Oct 19, 2026.
What can I use marker for?
Preparing PDF research papers or textbooks as markdown for RAG pipelines Converting scanned or digital forms and tables into structured data Batch-converting a folder of documents while keeping images and JSON structure Building custom post-processing steps with its processor and renderer interfaces
How do I install marker?
Install PyTorch from the official site for your platform Install marker with pip (Python 3.10+): pip install marker-pdf Convert a PDF to markdown: marker_single /path/to/file.pdf
Where can I get marker?
The source code and installation instructions are on GitHub: https://github.com/datalab-to/marker

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects