PDF to JSON extracts text, pages and metadata from a text-based PDF into a structured JSON object. Choose Structured for one object per page with paragraphs, Flat for a single long string, or Lines for an array of every line paired with its page. Add PDF metadata, group paragraphs automatically, and count words and characters. Then preview the JSON with syntax highlighting, review the Pages tab, and download or copy the result. Everything runs in your browser, so the file never leaves your device.
What is a PDF to JSON converter?
A PDF to JSON converter extracts text and structure from a PDF and writes them as JSON — a format that every programming language, every automation tool and most data pipelines can read directly. Instead of passing around a binary document that needs a PDF library to open, you get a plain-text object whose fields you can access by name: doc.pages[0].paragraphs[1].
People convert PDFs to JSON for many reasons: feeding a document into an AI model that expects structured input, indexing content for search, extracting metadata from a library of documents, or turning a report into data for a dashboard. JSON is the lingua franca of these workflows — no parser to install, no format to reverse engineer.
The tool uses pdf.js to read the PDF, then assembles the JSON in JavaScript. The structure follows a straightforward schema — metadata, page count, extracted timestamp, and either a pages array, a flat text string or a lines array, depending on the mode. You can read more about the PDF format on the PDF Wikipedia page and about JSON on json.org.
How to convert PDF to JSON in 5 steps
The process is short and needs no account. Follow these steps and the first JSON will be ready in under a minute.
- Add your PDFDrag a text-based PDF onto the upload card, click Browse, or import directly from Google Drive or Dropbox. The tool loads the file inside your browser using pdf.js.
- Choose extraction modeStructured gives one object per page with paragraphs — the best default. Flat text gives one long string. Line-by-line gives an array of every line with its page number.
- Pick pages and indentationExtract all pages, only the first, or a specific page. Indentation controls whether the JSON is pretty-printed (2 or 4 spaces) or minified for the smallest file.
- Toggle metadata and countsMetadata adds PDF info and Dublin Core fields. Paragraph grouping merges lines that share a tight baseline. Counts add word and character totals to each object.
- Convert and downloadClick Extract & Convert to JSON, review the JSON preview or the Pages tab, then download the .json file or copy it to the clipboard.
Extraction is fast because pdf.js reads the text layer directly instead of rendering and running OCR. A 100-page text PDF typically finishes in a few seconds. If the JSON is empty or nearly empty, the PDF is probably image-based, and you will need an OCR step first.
Everything the converter can do
| Setting | Options | What it does |
|---|---|---|
| Extraction mode | Structured, flat, lines | Page-per-object with paragraphs, one long string, or one entry per line. |
| Pages | All, first, custom | Extract everything, test the first page, or pick a single page. |
| Indent | 2 spaces, 4 spaces, minified | Pretty-prints the JSON or strips whitespace for a smaller file. |
| Metadata | On or off | Adds the PDF info dictionary and Dublin Core fields. |
| Paragraph grouping | On or off | Merges lines that share a tight baseline into paragraphs. |
| Counts | On or off | Adds word and character totals to each object. |
| JSON / Pages tabs | Live | Review the raw JSON with syntax highlighting, or the page-by-page preview. |
| Import sources | Device, Google Drive, Dropbox, clipboard | Loads the PDF without leaving the browser. |
Structured, flat and line-by-line modes
The three modes produce the same data in different shapes, so pick the one that matches how you plan to consume the JSON.
Structured
An array of page objects, each with its paragraphs. Best when you want to process content page by page, apply per-page styling, or count what is on each page.
Flat text
A single long string with paragraphs separated by double newlines. Best when you only need the text and want the simplest possible shape.
Line by line
An array of objects with page and text fields. Best for auditing, diffing, or searching by line number while keeping the source page.
Honest limit: paragraph grouping is a heuristic. The tool measures the vertical gap between lines and starts a new paragraph when the gap is significantly larger than the page median. That works well for books and reports, but PDFs with unusual typography — very wide leading, frequent bullet lists, mixed font sizes — can split paragraphs oddly. Turn it off if you want one line per entry.
Text-based vs scanned PDFs
This is the most important thing to understand about PDF to JSON conversion. PDFs come in two broad types, and only one of them works here.
Text-based PDFs
Created by Word, Google Docs, LaTeX, online invoices and most digital reports. They contain a real text layer that can be selected, copied and extracted. These work perfectly.
Scanned PDFs
Created by a scanner or a phone camera. Each page is a picture with no text layer. Selecting text does nothing. These need OCR first.
Quick test
Open the PDF and try to select a sentence with your mouse. If the text highlights, it has a text layer and this tool will read it. If nothing highlights, it is scanned.
Honest limit: OCR is not included in this tool. OCR engines add tens of megabytes and take much longer, so they belong in a dedicated workflow. If you have a scanned PDF, run it through an OCR tool first, save the result as a text-based PDF, then come back here.
Your PDF stays private
Everything happens in your browser. The PDF is loaded with pdf.js, the text is extracted page by page, and the JSON is assembled in JavaScript. Nothing is uploaded, logged or stored. When you close the tab, the file is gone from memory.
- Local processing. Text extraction and JSON assembly both run on your device, so confidential documents never leave your computer or phone.
- Direct cloud downloads. When you import from Google Drive or Dropbox, your browser fetches the file straight from that provider after you grant access.
- No account needed. You can convert without signing in. Read our privacy policy for details about the site itself.
Tips for better JSON output
- Check for a text layer first. Select a line with your mouse. If it highlights, the PDF will work.
- Start with Structured. It is the most useful shape for most downstream tasks and the easiest to inspect.
- Turn off paragraph grouping if lines matter. Some pipelines prefer one line per entry to one paragraph per entry.
- Use minified output for storage. It is smaller and easier to compress. Pretty-print when you plan to read the JSON by eye.
- Try a small page range first. Extract one page, inspect the shape, and only then process the whole document.
- Compress the source PDF. Smaller PDFs extract faster. Run them through our Compress PDF tool first.
Common problems and quick fixes
| Problem | Likely cause | Fix |
|---|---|---|
| JSON is empty or nearly empty | The PDF is scanned or image-only | Run it through an OCR tool first, or test by selecting text in a viewer. |
| Paragraphs are jumbled | Multi-column PDF | Try line-by-line mode to see the raw extraction order, or turn off paragraph grouping. |
| JSON is very large | Pretty-printed output on a long document | Switch indent to Minified and re-convert. |
| Metadata is missing | The PDF has no info dictionary | Some PDFs are created without metadata. Try a different PDF or leave metadata off. |
| Cloud import fails | The sign-in window was blocked | Allow pop-ups for this site, then press the Drive or Dropbox button again. |
Import from Drive and Dropbox, then share
You do not need to download the PDF to your phone first. The upload card includes Google Drive and Dropbox buttons, and the editor toolbar repeats them. The provider opens its own file picker, you select the PDF, and the tool downloads it into the page list with a live progress bar.
After conversion, the share panel appears under the download button. You can post a link to the tool on WhatsApp, Facebook, X, LinkedIn or Telegram, send it by email, or copy the link. On phones and tablets that support the Web Share API, the Share JSON file button opens the system share sheet with the output attached.
Related PDF tools
These pair naturally with PDF to JSON and are all free.
Frequently asked questions
Is the PDF to JSON converter free?
Does the tool upload my PDF to a server?
Can I import PDFs from Google Drive or Dropbox?
What is the difference between Structured, Flat text and Line by line?
What metadata is included?
How does paragraph grouping work?
What kind of PDFs work with this tool?
Does it support OCR for scanned PDFs?
Can I convert only specific pages?
Will tables be preserved as structured JSON?
How big is the JSON output?
Does it work on iPhone and Android?
Ready to extract your JSON?
Load a text-based PDF, pick a mode, and download structured JSON in seconds. Free, private and built for every device.
Convert PDF to JSON