PdfLuxe logoPdfLuxe

PdfLuxe › Tools › PDF to JSON

PDF to JSON

Extract a PDF's structure into a JSON file — document metadata, one entry per page, and the page's text rebuilt into lines with their positions. It is completely free, needs no sign-up and adds no watermark — and it runs in your browser, so your file is processed on your device and never uploaded.

PDF → JSON
Open PDF to JSON — free

How to use PDF to JSON

  1. Add your PDF — its text layer is read on your device, never uploaded anywhere.
  2. Tap Extract JSON. Pages, text lines and document metadata are collected.
  3. Download the .json file, ready for scripts, spreadsheets and other tools.

Good to know

How PDF to JSON works

This tool reads your PDF with PDF.js in your browser and walks it page by page, collecting what a program would want to know: the page count, each page's dimensions, its extracted text, and the document's metadata such as title and author when present. That information is assembled into a structured JSON document — pages as an array, text as strings, numbers as numbers — and downloaded as a .json file. Nothing is rendered and nothing is uploaded; it is a data extraction, not a visual conversion.

JSON is the interchange format of modern software, so the output drops straight into a script, a spreadsheet import, a database load or an AI pipeline. The text extraction follows the PDF's own text layer: a born-digital PDF yields clean, ordered text, while a scanned PDF has no text layer to extract — its pages appear with empty or minimal text until the file has been through OCR. Reading order follows the order text is stored in the file, which on multi-column pages may differ from visual reading order.

When to use PDF to JSON

Privacy — your files stay on your device

Your files are processed on your own device, in your browser, and are never uploaded. There is no account, no sign-up and no cloud copy of your document: the work happens in this tab, and the result exists only as the file you download. Extraction runs in this tab with PDF.js; your PDF and its text never leave your device.

Questions people ask

Is this really free?

Yes. Every tool in PdfLuxe is free with no premium tier: no sign-up, no credits that run out, and no watermark on what you download.

Are my files uploaded anywhere?

No. The conversion runs entirely in your browser, on your own device. The file you add is never uploaded to a server.

What exactly is in the JSON?

The document's metadata (title, author, creator and similar fields, when the PDF carries them), the page count, and for every page: its size in points, its rotation, its full text, and its text broken into lines — each line with its vertical position and its individual text items with x position, width, height and font name.

Why did some pages come back with no text?

This tool reads the PDF's text layer. A scanned page is a photograph of text and has no text layer, so its lines are empty — the result tells you how many pages had no text. Run the PDF through OCR PDF first to add a text layer, then extract again.

How are lines decided?

Text items that share the same baseline on the page are grouped into one line, in reading order, using the positions pdf.js reports. Multi-column pages can interleave columns within a line group — the per-item positions are included so your own code can re-sort if it needs to.

Is layout or formatting preserved?

Only as data: positions, sizes and font names are in the JSON, but colours, images and vector graphics are not extracted. For a visual copy of the pages, use PDF to JPG or PDF to PNG instead.

What can I use the JSON for?

Feeding a document into your own script or app, checking what text a PDF really contains, building an index or search, or handing structured text to another tool without copy-pasting from a viewer.

What exactly is inside the JSON file?

Document-level metadata (such as title, author and page count where the PDF provides it) and a per-page record with the page's size and its extracted text. The exact fields follow what the PDF itself contains — a file with no metadata set produces empty metadata fields, not invented ones.

For people who need the document as data

Most PDF tools answer 'what does this page look like?' PDF to JSON answers 'what does this document contain?' — in a form software can use directly. Developers use it to pipe PDF text into apps and pipelines; careful readers use it to see exactly what text a PDF holds, in order, with the metadata the file claims about itself. The extraction runs on your device with pdf.js — the same reader the preview uses — so the JSON reflects the document's real text layer, nothing guessed.

Structure of the output

The file is one JSON object: file and extractedAt say where it came from; metadata carries the document info dictionary; pages is an array with one object per page — page number, width and height in PDF points, rotation, the page's lines, and the page's text as one string. Each line lists its items separately, so nothing about the original positioning is lost.

Honest limits

This reads the text layer only: scanned or photographed pages contain no extractable text and come back empty (the result counts them for you) — OCR first if you need their words. Images, colours and vector drawings are not part of the output, and line grouping follows baselines, so complex multi-column layouts may need re-sorting in your own code using the item positions provided. Very large documents produce very large JSON files. And nothing is uploaded: the extraction happens in your browser.

Related tools

Open PDF to JSON in PdfLuxe

Questions about this tool? Email support@pdfluxe.com.