Skip to main content

Tidy Byte Tools

doc2md-lite

License: MIT Python 3.10+ MCP server MCP Registry PyPI downloads Glama score

Free. No API key. Runs on your own computer, so your files stay with you.

A tool that turns a text PDF or a saved web page (.html) into clean Markdown. Tables stay real Markdown tables. Need Word files, chunks for AI search (RAG), whole folders or page ranges? The paid version does that: doc2md on Gumroad

Runs on your own computer, so your files are never uploaded anywhere. MIT license. Python 3.10 or newer, on Windows, Mac and Linux.

Install

pip install doc2md-lite

Or use pipx, which keeps it in its own space:

pipx install doc2md-lite

Want the newest code from GitHub instead?

pip install git+https://github.com/tidybytetools/doc2md-lite

Use it

doc2md-lite report.pdf                 # writes report.md
doc2md-lite page.html -o page.md
doc2md-lite report.pdf -o -            # print the Markdown on screen
doc2md-lite report.pdf --tables text   # also find tables with no border lines

Example run:

Saved: report.md  (4 headings, 1 tables)

What you get from a PDF:

# Spring Store Report

Our team checked every store in March. Most stores met the new goal...

## Sales by region

| Region | Stores | Sales |
| --- | --- | --- |
| North | 12 | $48,200 |
| South | 9 | $39,950 |

What it keeps: headings (found by font size and bold in PDFs), paragraphs, bullet and numbered lists, tables, and in HTML also bold, italic, links and code blocks. From web pages it drops scripts, styles, menus and footers.

When you run it in a terminal it ends with one short line about the paid version. --quiet turns it off, and it never shows when output is piped or redirected.

Known limits

  • Scanned PDFs. Pages that are just an image (no text layer) are skipped, and the tool tells you which ones.
  • Headings in PDFs are a best guess from font size and bold. Odd layouts may need a quick fix.
  • Two-column PDFs (like science papers) may mix the columns.
  • One file at a time. No folders, no page ranges, no Word files, no RAG chunks. The paid version has those.
  • Files only. It does not download web pages. Save the page first.

Lite vs paid

lite (free) doc2md
Text PDF and HTML to Markdown yes yes
Tables kept as Markdown tables yes yes
Word (.docx), with bold, italic, links and lists no yes
RAG chunks (JSONL with page, heading path, size and overlap) no yes
Whole folders, sub-folders too no yes
Page ranges and password-protected PDFs no yes

Other good free tools

Pick what fits you. MarkItDown reads many more file types. pandoc is great for Word and HTML but does not read PDFs. pymupdf4llm is fast on PDFs but uses the AGPL license. doc2md-lite is small, MIT, keeps PDF tables as tables, and has an MCP server built in.

Use it with your AI app (MCP)

There is a small free MCP server built in. It gives your AI app one tool, convert_to_markdown. No API key or account is needed. It needs uv, which gives you the uvx command.

Run it by hand to check it starts (it waits quietly for an app to talk to it):

uvx --from doc2md-lite doc2md-lite-mcp

Shorter way to start the same server: uvx doc2md-lite mcp.

Pick your app below and copy the block. Restart the app after you save.

Claude Desktop

Open Settings > Developer > Edit Config. That opens claude_desktop_config.json. Add this:

{
  "mcpServers": {
    "doc2md-lite": {
      "command": "uvx",
      "args": ["--from", "doc2md-lite", "doc2md-lite-mcp"]
    }
  }
}

If Claude says it can't find uvx, run which uvx (Mac/Linux) or where uvx (Windows) and put that full path in "command".

Cursor

Put the same block in ~/.cursor/mcp.json (all projects) or .cursor/mcp.json (one project):

{
  "mcpServers": {
    "doc2md-lite": {
      "command": "uvx",
      "args": ["--from", "doc2md-lite", "doc2md-lite-mcp"]
    }
  }
}

VS Code

VS Code uses servers, not mcpServers. Put this in .vscode/mcp.json in your project, or run MCP: Open User Configuration to use it everywhere:

{
  "servers": {
    "doc2md-lite": {
      "type": "stdio",
      "command": "uvx",
      "args": ["--from", "doc2md-lite", "doc2md-lite-mcp"]
    }
  }
}

Or add it with one command:

code --add-mcp '{"name":"doc2md-lite","type":"stdio","command":"uvx","args":["--from","doc2md-lite","doc2md-lite-mcp"]}'

Cline

In the Cline panel, click the MCP Servers icon, open Configure, then click Configure MCP Servers. Add this inside mcpServers:

{
  "mcpServers": {
    "doc2md-lite": {
      "command": "uvx",
      "args": ["--from", "doc2md-lite", "doc2md-lite-mcp"],
      "disabled": false,
      "autoApprove": []
    }
  }
}

Codex

One command:

codex mcp add doc2md-lite -- uvx --from doc2md-lite doc2md-lite-mcp

Or add this to ~/.codex/config.toml:

[mcp_servers.doc2md-lite]
command = "uvx"
args = ["--from", "doc2md-lite", "doc2md-lite-mcp"]

Gemini CLI

This repo is also a Gemini CLI extension. Install it with:

gemini extensions install https://github.com/tidybytetools/doc2md-lite

Tool: convert_to_markdown(path, tables="lines", output_path=""). It returns the Markdown text. If you set output_path, it saves the file there and returns the path instead.

For AI agents

  • Use when: you have a local PDF with real text (you can select the words) or a saved HTML file, and you want Markdown to read or store.
  • Don't use when: the PDF is a scan, the file is .docx, or you need many files or chunks with page numbers. Use the paid version for those.
  • Input: a file path, plus optional tables (lines, text, off).
  • Output: Markdown text. Tables are Markdown tables with the first row as the header.
  • CLI exit code is 0 on success and 1 on error (message on stderr, or {"ok": false, "error": ...} with --json). See also llms.txt.

Python

from doc2md_lite import convert
md, info = convert("report.pdf")   # info: type, tables, headings, scanned_pages

Tests

pip install pdfplumber beautifulsoup4 reportlab "mcp<2"
python3 -m unittest discover tests

License

MIT. See LICENSE.

Metadata

Release files for doc2md-lite 1.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for doc2md-lite 1.1.1
File Size Uploaded Provenance Actions
doc2md_lite-1.1.1.tar.gz 16.7 kB With provenance Details for doc2md_lite-1.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for doc2md-lite 1.1.1
File Interpreter ABI Platform Actions
doc2md_lite-1.1.1-py3-none-any.whl Python 3 none any Details for doc2md_lite-1.1.1-py3-none-any.whl

Total release size: 28.7 kB

Release files / doc2md_lite-1.1.1.tar.gz

Download URL doc2md_lite-1.1.1.tar.gz
Size 16.7 kB
Tags Source
SHA-256 checksum
How to use checksums
8dcfa40a523ca45572cba58c6e5b6a152cf1ced45d9f3580bde08b35771d3656
BLAKE2b-256 checksum
How to use checksums
245b1c6b70287ec26677ede2ad31da5a1084ad53a7905933953e566a039f27c4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 4, 2026.

Transparency log

Release files / doc2md_lite-1.1.1-py3-none-any.whl

Download URL doc2md_lite-1.1.1-py3-none-any.whl
Size 12.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1becb7ae03254a65409f9af0975c2b1eb064a266de655835dadcfa9c845309e2
BLAKE2b-256 checksum
How to use checksums
8d2b4da5b016b8bef47d0ddfdb87451ce41f809ff533de88e1541395d69fbc7b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 4, 2026.

Transparency log

Security for doc2md-lite 1.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for doc2md_lite-1.1.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 4, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page