PDF to JSON Converter — Free & Online
Turn any PDF into structured JSON — headings, lists, and text with positions. No upload, no API key, no limits.
What can you do with PDF as JSON?
Machine-readable structure instead of a wall of text.
Chunk for RAG
Typed lines make it straightforward to split a document at semantic boundaries rather than at arbitrary character counts.
No API Key
Document parsing APIs bill per page and require sending the file to a third party. This runs in your browser, free, on documents you cannot legally upload.
Positions and Font Sizes
Every line carries its page number, vertical position and font size — enough to rebuild layout logic downstream.
Pipeline-Ready
Pipe the JSON into scripts, ETL jobs, or a vector store without a PDF library anywhere in your stack.
How to convert PDF to JSON
Three steps and a few seconds.
-
1
Select your PDF
Drag and drop the file or browse your device. Any size, any page count.
-
2
Structure is extracted
Each line is classified and tagged with its page, position and font size — on your own device.
-
3
Copy or download
Copy the JSON or save it as a .json file, ready for your pipeline.
Need something simpler? Extract plain text for reading and indexing, or convert PDF to Markdown for structured prose.
The shape of the output
The result is a single object with fileName, pageCount, and a pages array. Each page holds an array of lines, and each line carries four things: a type of heading, list_item or text; the text itself; the fontSize it was drawn at; and its vertical position on the page.
Line types are inferred rather than declared, because a PDF does not record them. A line set noticeably larger than the surrounding body text is classified as a heading; a line beginning with a bullet or numeric marker is classified as a list item; everything else is text. The font size is included precisely so you can second-guess that classification and apply your own threshold.
The vertical position is what makes reconstruction possible. Large gaps between consecutive lines usually mean a section break, and lines sharing a position across many pages are almost certainly running headers or footers — both of which are much easier to detect with coordinates than with text alone.
Chunking PDFs for RAG
The default approach to retrieval-augmented generation — split the text every N characters with some overlap — is fast and mediocre. It cuts sentences in half, splits tables from their captions, and produces chunks that begin mid-thought, which is exactly the sort of context an embedding model handles worst.
Typed lines let you do better. Start a new chunk at every heading, and each chunk becomes a section that stands on its own. Carry the heading text into the chunk so the embedding captures what the section is about, not only what it says. Merge short chunks with their neighbours, and split overlong ones at the nearest line break rather than mid-word.
Because the page number travels with every line, citations come free: when the model retrieves a chunk you can tell the user which page of which document it came from. That is usually the difference between an answer a reader trusts and one they cannot check.
Why this runs in the browser and not behind an API
The commercial document-parsing services all work the same way: you upload the file, they parse it, you pay per page. That is a reasonable trade for public documents and an impossible one for the documents that most need parsing — contracts under NDA, patient records, unreleased financials, anything where "we sent it to a third party for processing" is the sentence you cannot write.
Running pdf.js in the browser removes the trade entirely. There is no key to rotate, no per-page bill, no rate limit, no data-processing agreement to negotiate, and no vendor retention policy to read. Because there is no server round trip, the tools keep working with the network disconnected. Load the page, turn off Wi-Fi, and the conversion still runs — which is the most direct proof available that nothing is being uploaded.
Frequently asked questions
How do I convert a PDF to JSON?
Drop your PDF into the box above. The tool extracts every line of text and outputs structured JSON — with page numbers, line types (heading, list item, text), font sizes, and positions. Copy it or download the .json file.
What does the JSON output look like?
An object with fileName, pageCount, and a pages array. Each page contains its lines, and each line has a type (heading, list_item, or text), the text content, font size, and vertical position — ready for custom pipelines, scripts, or LLM ingestion.
Is this PDF to JSON converter free?
Yes, with no sign-up and no rate limit. Because pdf.js is doing the parsing on your own CPU rather than a hosted document API, there is no per-page bill behind the scenes to recover.
Are my PDFs sent to a parsing API?
No. This deliberately avoids that model — pdf.js extracts every line in your browser, so a document you are not allowed to upload to a third party is exactly the kind of file this is safe for.
How are headings detected if PDFs do not store them?
By relative font size. A line drawn noticeably larger than the surrounding body text is classified as a heading. The raw font size is included in the output so you can apply your own threshold if the document uses an unusual scale.
How should I chunk this JSON for a vector database?
Start a new chunk at each line of type heading and prepend that heading text to the chunk, so every chunk is a self-contained section with its topic stated. Merge very short sections and split long ones at line boundaries rather than mid-sentence.
When should I use PDF to JSON instead of PDF to text or Markdown?
Choose JSON when you need structure a program can consume — for example filtering headings, rebuilding a table of contents, chunking documents for RAG, or feeding a data pipeline. For reading or notes, plain text or Markdown is simpler.
Why is the JSON output empty?
Your PDF is probably scanned (images without a text layer). Run it through OCR first, then convert it here.