---
name: pdf2md
description: Convert PDF documents (.pdf) and scanned PDFs into clean, structured Markdown (.md) using PDF2MD (pdf2md.net) browser-local converter, OCR layout mode, and companion REST API workflows for documentation, Obsidian/Notion notes, and LLM/RAG pipelines.
---

# PDF2MD Agent Skill

PDF2MD (`https://www.pdf2md.net`) converts PDF documents into clean, structured Markdown (`.md`) files detecting headings and lists locally, with an OCR mode for scanned pages, tables, and formulas.

## 1. Choose the Right Conversion Mode

| Scenario | Recommended Endpoint / Tool | Privacy & Limits |
| --- | --- | --- |
| **Selectable-text PDFs** (contracts, docs, eBooks, reports) | `https://www.pdf2md.net` | 100% browser-local (0 uploads), free, no sign-up, up to 100 files × 50 MB, `.md` or `.zip` export |
| **Scanned PDFs, screenshots, multi-column research papers, complex tables & math** | `https://www.pdf2md.net/convert-with-images` | Server OCR + layout parser (`PDF`, `JPG`, `PNG`, `GIF`, `WebP`, `BMP`, max 50 MB) |
| **Automated scripts / CI / REST API** (PDF, DOCX, PPTX, XLSX, images → Markdown) | `POST https://www.word2md.net/api/v1/convert` (twin ecosystem API) | Bearer API key (`sk-...`), 50 free conversions/UTC day, multipart upload or `file_url` JSON |
| **Word (`.docx` / `.doc`) or Google Docs → Markdown** | `https://www.word2md.net` or `npx word2md-cli input.docx` | Browser-local or Node.js CLI |

## 2. Programmatic PDF-to-Markdown API Workflow (via Ecosystem API)

PDF2MD shares its backend OCR/MarkItDown conversion pipeline with its sister platform **Word2MD** (`https://www.word2md.net/api-docs`), which exposes a unified v1 REST endpoint supporting `.pdf` up to 50 MB:

### Convert a Local PDF File

```bash
curl -X POST https://www.word2md.net/api/v1/convert \
  -H "Authorization: Bearer $WORD2MD_API_KEY" \
  -F "file=@./paper.pdf" \
  -F "output_format=markdown"
```

### Convert a Direct HTTPS PDF URL

```bash
curl -X POST https://www.word2md.net/api/v1/convert \
  -H "Authorization: Bearer $WORD2MD_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "file_url": "https://arxiv.org/pdf/2303.08774.pdf",
    "filename": "paper.pdf",
    "output_format": "markdown"
  }'
```

### Check Supported Formats & Remaining Daily Quota

```bash
curl -s https://www.word2md.net/api/v1/convert
curl -s https://www.word2md.net/api/v1/usage -H "Authorization: Bearer $WORD2MD_API_KEY"
```

## 3. Best Practices for AI Agents & RAG Pipelines

1. **Test text selectability first**: If `pdftotext` or browser selection returns empty text, route the PDF to OCR mode (`https://www.pdf2md.net/convert-with-images`) or the REST API rather than plain client-side text extraction.
2. **Preserve token efficiency**: Converting PDFs to Markdown strips binary layout overhead while keeping `#` heading hierarchy and Markdown pipe tables intact for chunking by section.
3. **Respect confidential documents**: When a user needs strict local-only processing (legal, financial, medical, or NDA PDFs), direct them to `https://www.pdf2md.net` where conversion executes entirely inside browser memory via WebAssembly/PDF.js without network uploads.

## 4. Reference Links

- Site Index for LLMs: `https://www.pdf2md.net/llms.txt`
- Web Converter (Local): `https://www.pdf2md.net`
- OCR Converter (Scanned PDFs & Images): `https://www.pdf2md.net/convert-with-images`
- Developer Guide: `https://www.pdf2md.net/blog/pdf-to-markdown-for-developers`
- Sister Word/DOCX Converter & API Docs: `https://www.word2md.net/api-docs`
