mq-conv turns PDFs, Office docs and other formats into structure-preserving Markdown. Local, offline, one binary.
Get started Read the docs View on GitHubcurl -fsSL https://raw.githubusercontent.com/harehare/mq-conv/main/bin/install.sh | bash
$ mq-conv report.pdf --max-tokens 4000 # Quarterly Report Revenue grew across all regions. ## Results | Region | Q1 | Q2 | | ------ | --- | --- | | EMEA | 1.2 | 1.5 | | APAC | 0.9 | 1.4 | <!-- mq-conv: next-cursor=18342 chunk-tokens=3921 total-tokens=187450 --> $ mq-conv report.pdf -q '.h2' ## Results
Plain Markdown on stdout, ready to pipe into mq. Slice a manual into sections, filter tables, or feed an LLM only what fits.
# Pull one section out of a Word doc
mq-conv document.docx | mq -A 'section::section("Summary")'
# Sections small enough to paste into a prompt
mq-conv manual.pdf -q '.h2 | select(tokens(.) < 500)'
# Only some pages, numbers stay those of the source
mq-conv report.pdf --pages 3-5
Structure from the file itself, not a text dump and not a cloud parser.
Native glyph parser: columns, headings, lists, ruled and borderless tables, CJK fonts. Running headers and footers removed.
No API keys, no network, no Python or Node runtime. A single static binary.
PDF pages and input files convert on all cores. A broken page never takes the document down.
--max-tokens and --cursor page through large documents at block boundaries.
-q runs an mq query with tokens(), format() and filename().
--pages picks PDF pages, slides, sheets or EPUB chapters.
--extract-images writes embedded images and links them; Tesseract OCR for scans.
--to writes any input as docx, HTML, LaTeX, RST, AsciiDoc, Org, EPUB or JSON.
Enable only the formats you need with feature flags; core formats also run in the browser.
Detected by extension and magic bytes.
PDF, Word, PowerPoint, EPUB
reStructuredText, Org-mode, MediaWiki, AsciiDoc
Excel, SQLite
Images, audio, video, ZIP, TAR