mdgate converters

PDF to Markdown in your browser.

Convert PDF files to GitHub-Flavored Markdown directly in your browser.

Your PDF stays on your device. No upload. No account.

Starting local converter

Use PDF to Markdown in your app

$ npm install @mdgate/pdf

import { toMarkdown } from '@mdgate/pdf';

const markdown = await toMarkdown(bytes);

Pure TypeScript, Node.js, Cloudflare Workers, Edge, Browser, No Python, No native addons, No WASM, Zero third-party runtime dependencies

How PDF to Markdown works

  1. PDF
  2. deterministic parsing
  3. reading order · text · tables · structure
  4. GitHub-Flavored Markdown

Built for JavaScript runtimes

Node.js

Read local files, uploads, S3/R2 objects, and other byte sources.

Cloudflare Workers

Parse PDFs directly inside Workers without a Python service or native binary.

Browser

Convert text-based PDFs locally without uploading them to a server.

Edge

Run the same TypeScript converter in compatible Edge runtimes.

What @mdgate/pdf extracts

  • Page reading order
  • Positioned text
  • Common font encodings
  • Embedded character maps
  • CJK text
  • Superscript and subscript
  • Table-like layouts
  • Duplicate and overlapping text
  • Encrypted PDF detection

Text-based PDF vs Scanned / image-heavy PDF

Text-based PDF

PDF text → @mdgate/pdf → Markdown

Scanned / image-heavy PDF

PDF images → your image / vision pipeline

@mdgate/pdf does not silently send PDFs to an OCR or AI service.

Why @mdgate/pdf

Runs where your JavaScript runs

No separate processing service. The converter is TypeScript you can call from Node.js, Cloudflare Workers, Edge runtimes, and browsers.

Local conversion

PDF files can stay inside your application or browser.

Content detection

Recognizes PDF files from their contents, not only the filename.

Deterministic parsing

The same PDF file produces repeatable Markdown without model inference.

Small runtime surface

No Python. No native addons. No WASM. No third-party runtime dependencies.

PDF for AI agents

Turn PDF files into content your agent can actually work with.

  1. PDF
  2. Markdown
    • grep
    • search
    • chunk
    • index
    • cache
    • cite
    • reason

Need more than PDF?

One format

@mdgate/pdf

Your own set

@mdgate/core
+ @mdgate/pdf
+ @mdgate/docx
+ @mdgate/pptx

Broad file support

@mdgate/converters

FAQ

Can I convert PDF to Markdown without uploading it?

Yes. PDF files can be converted locally in the browser.

Does PDF to Markdown work in Cloudflare Workers?

Yes. @mdgate/pdf runs directly in Cloudflare Workers.

Does it require Python?

No.

Does it require native addons or WASM?

No.

What does it output?

GitHub-Flavored Markdown.

Can I install only the PDF converter?

Yes. Install @mdgate/pdf instead of the complete converter set.

Does it support scanned PDFs?

@mdgate/pdf deterministically parses textual PDF content. Text visible only inside scanned images requires an image or vision pipeline.