PDF to Markdown
Convert PDFs to clean Markdown and JSONL chunks for RAG, keeping tables and reading order.
Install
irm https://raw.githubusercontent.com/chayprabs/localtools/main/pdf-to-markdown/install.ps1 | iexlocaltools-pdf-to-markdown updatelocaltools-pdf-to-markdown uninstall
curl -fsSL https://raw.githubusercontent.com/chayprabs/localtools/main/pdf-to-markdown/install.sh | bashlocaltools-pdf-to-markdown updatelocaltools-pdf-to-markdown uninstall
pipx install localtools-pdf-to-markdownpipx upgrade localtools-pdf-to-markdownpipx uninstall localtools-pdf-to-markdown
Opens at http://127.0.0.1:47104 in your browser. Run localtools-pdf-to-markdown --help for the command line. Set LOCALTOOLS_NO_OPEN=1 to install without opening it.
Direct download
| Platform | File | Size |
|---|---|---|
| Linux x64 | pdf-to-markdown-1.0.3-linux-x64.zip | 41.2 MB |
| macOS Apple Silicon | pdf-to-markdown-1.0.3-macos-arm64.zip | 28.4 MB |
| macOS Intel | pdf-to-markdown-1.0.3-macos-x64.zip | 28.9 MB |
| Windows x64 | pdf-to-markdown-1.0.3-windows-x64.zip | 24.0 MB |
SHA-256 checksums are in the release notes; the install scripts verify them for you.
See it
How to use
- Choose or drop a PDF (up to 64 MiB). It needs a text layer; scanned pages are reported, not OCR'd.
- Optionally enter a page range like 1-5,9, a chunk size in tokens and an overlap, and tick Extract images.
- Press Convert. Read the result as rendered Markdown, as raw Markdown, or as the chunks table with pages and heading paths.
- Download the Markdown, the ZIP with images, or the chunks as JSONL for your RAG pipeline.
FAQ
Does it handle two-column papers and tables?
Yes. Columns are detected from the gaps between them and read one after the other. Ruled tables, tables ruled only between columns, and tables bounded by horizontal rules (booktabs) become Markdown tables, or HTML tables when cells are merged. Tables aligned only by spaces stay as text.
What is in the JSONL chunks?
One object per line with the chunk text, estimated tokens, page numbers, heading path and start/end character offsets. Each chunk is an exact slice of the Markdown, chunks start at headings and repeat about the overlap you set when a section is split.
Can it read scanned PDFs?
No. There is no OCR, so pages without a text layer are reported by number and left empty, and a fully scanned PDF gets a clear 'no text layer' error.
Can I use it from the command line?
Yes: localtools-pdf-to-markdown convert in.pdf -o out.md (or -o out.zip with images), and localtools-pdf-to-markdown chunks in.pdf --max-tokens 512 --overlap 64 -o chunks.jsonl.
What are the limits?
64 MiB and 1,000 converted pages per PDF (use a page range for longer ones), 120 seconds per conversion and two at a time. Each conversion runs in a worker process that is killed if it runs too long. Nothing leaves your computer.