pdftojson.dev
PDF → JSON · Markdown · CSV

Turn any PDF into clean, structured JSON.

Drop a file — it's parsed right here in your browser. For scanned docs, tables, and batch, there's an API.

— no file —
Your output appears here.
Runs in your browser Nothing uploaded Scanned & tables via API Free to use

Building something? Same parse, one call.

Send a PDF, get the same structured output back — plus OCR for scanned files and table extraction. Batch-ready.

Read the API docs →
# POST a file, get JSON curl -X POST https://api.pdftojson.dev/v1/extract \ -H "Authorization: Bearer $KEY" \ -F file=@doc.pdf -F format=json

Why JSON out of a PDF?

A PDF is built for viewing, not for reading with code. The content is there, but it’s wrapped in a page-description format that’s awkward to work with programmatically. JSON is the opposite: it’s the format code speaks. Every language parses it, every database stores it, and every API passes it around.

So converting a PDF to JSON is really about getting a document into a shape your software can actually use — to load it into a database, feed it to a language model, drive a pipeline, or pull out specific fields. Instead of a page you have to look at, you get structured data you can loop over.

How to convert a PDF to JSON

  1. Drop your PDF into the box above (or click to choose one).
  2. It’s parsed in your browser using its text layer — nothing is uploaded.
  3. Pick the JSON shape you want — Structured, By paragraph, or Words + positions.
  4. Copy the JSON, or switch to Markdown, Text, or CSV.

No account, no upload, no cost for text-based PDFs.

What the JSON looks like

The default Structured shape gives you pages, each with its text and typed blocks:

{
  "pages": [
    {
      "page": 1,
      "text": "Invoice #1042\nBilled to: Acme Co\nTotal: $1,240.00",
      "blocks": [
        { "text": "Invoice #1042", "size": 18 },
        { "text": "Billed to: Acme Co", "size": 11 },
        { "text": "Total: $1,240.00", "size": 11 }
      ]
    }
  ]
}

Each block keeps its font size, which is often enough to tell a heading from body text — useful when you want to rebuild the document’s structure downstream.

Three JSON shapes, one tool

Different jobs want the data in different forms, so the tool gives you three:

Tick Include PDF metadata to add the document’s title, author, subject, and creation dates to the output.

PDF to JSON for LLMs and pipelines

A lot of PDF-to-JSON traffic these days is people preparing documents for AI. If that’s you, the By paragraph shape is usually the one you want: it gives you clean, reading-order text blocks you can turn straight into chunks and embeddings, without a wall-of-text dump or the noise of per-character positions.

If you’re building something more structured — pulling named fields out of invoices, extracting a table of line items, matching a schema — that’s where the API’s extraction earns its place, because it can run OCR on scans and detect real tables. But for “get this document into clean JSON I can chunk,” the browser tool covers a surprising amount of ground on its own.

Do it in code

The browser tool is for one-off conversions. To do it in your app — in bulk, on scanned files, or with table extraction — call the API.

curl -X POST https://api.pdftojson.dev/v1/extract \
  -H "Authorization: Bearer $KEY" \
  -F file=@document.pdf -F format=json
import requests

data = requests.post(
    "https://api.pdftojson.dev/v1/extract",
    headers={"Authorization": f"Bearer {KEY}"},
    files={"file": open("document.pdf", "rb")},
    data={"format": "json"},
).json()
const form = new FormData();
form.append("file", fs.createReadStream("document.pdf"));
form.append("format", "json");

const data = await fetch("https://api.pdftojson.dev/v1/extract", {
  method: "POST",
  headers: { Authorization: `Bearer ${KEY}` },
  body: form,
}).then((r) => r.json());

Same output as the browser tool, plus OCR for scans and table extraction — and it’s batch-ready.

Digital vs scanned PDFs

This distinction explains most “why didn’t it work?” moments, so it’s worth knowing.

A digital PDF was created by software and carries a real text layer — the tool reads it directly, in your browser, for free. A scanned PDF is just images of pages; there’s no text underneath, so there’s nothing to extract until something has read the image. The tool detects that case and points you to the API, which runs OCR plus a vision model to pull the text out anyway. A quick check: if you can select and copy text in a normal PDF viewer, it’s digital; if you can’t, it’s a scan.

The cases that need cleanup

Most everyday PDFs convert cleanly. A few don’t, and it’s usually one of these:

PDF to JSON vs other tools

Is PDF to JSON private?

Text-based PDFs never leave your device — parsing happens entirely in your browser, so there’s nothing to upload, store, or delete. OCR and table extraction run on the API, where files are processed by the service under its current data-retention policy.

What JSON shape do I get?+

Structured (pages → blocks with font sizes), By paragraph (merged reading-order text), or Words + positions (every word with coordinates). Table extraction runs on the API.

Which shape should I use for an LLM or RAG pipeline?+

By paragraph — it gives you clean, reading-order text blocks that chunk naturally into embeddings.

Is my PDF uploaded anywhere?+

No. Text-based PDFs are parsed entirely in your browser — the file never leaves your device.

What about scanned PDFs?+

They have no text layer, so the browser tool can't read them. The API runs OCR and a vision model for those.

How do I convert a PDF to JSON in code?+

Send the file to POST /v1/extract with format=json and a bearer key — snippets above, full details in the API docs.

Can it pull out specific fields or tables?+

Field- and table-level extraction runs on the API, which can detect tables and read scans; the browser tool gives you the document's text as structured JSON.

Is it really free?+

Yes for text-based PDFs in the browser. The API (scanned docs, tables, batch) is metered.