PDF to JSON Converter
Turn a document table into something a program can consume. Every table found is offered, the one you pick becomes an array of objects, and the PDF stays on your machine.
To convert PDF to JSON, drop your document above. Every table found is listed, and the one you choose becomes an array of objects keyed by its header row, with a single type per column and null for empty cells. The PDF is read in your browser with pdf.js and is never uploaded.
Want to clean the rows first? Open the app
The document is the API
Some organisations publish only as PDF. A regulator issues a rate table, a supplier sends a price list, a public body releases statistics, and none of them offers a feed. If your system needs those numbers, the document is the interface whether anyone likes it or not.
The second case is a pipeline that already exists on paper. Invoices arrive as PDFs, somebody keys them into a system, and the obvious improvement is to extract the line items instead.
In both, JSON rather than a spreadsheet is the right target, because the next step is code.
What extracts well, and what does not
Table extraction from a PDF is inference, not decoding. A PDF stores glyphs at coordinates; it does not store a table. The extractor infers rows and columns from where the text sits on the page, and how well that works depends entirely on the document.
- Works well: anything generated by software from real data. Bank statements, invoices, financial reports, system exports, tables produced by a reporting tool. The columns line up because a program placed them.
- Works reasonably: a table in a Word or LaTeX document exported to PDF, provided it has consistent column positions and no wrapped cells.
- Works badly: tables with cells that wrap onto several lines, tables split across a page break, tables with merged header cells spanning columns, and multi-column page layouts where two tables sit side by side.
- Does not work at all: a scan or a photograph. Those are images with no text layer, and there is nothing to extract. A note tells you when that is the case rather than handing back an empty result.
Every hosted competitor on this term promises more than this. The honest position is that a generated document converts cleanly and a scanned one does not, and knowing which you have before you start saves the disappointment.
Worked example
A line-item table from an invoice, extracted:
[
{
"line": 1,
"code": "SKU-0041",
"description": "Wireless Mouse",
"qty": 12,
"unit_price": 23.07,
"amount": 276.84
},
{
"line": 2,
"code": "SKU-0108",
"description": "27in Monitor",
"qty": 2,
"unit_price": 140.33,
"amount": 280.66
}
]
line, qty, unit_price and amount are numbers because every value in each of those columns is one. code is a string. The keys come from the extracted header row exactly as it appeared, without being normalised into snake case, because normalising is a decision with several reasonable answers and you should get to make it.
The validation you should still write
JSON extracted from a PDF should be treated as untrusted input, however good it looks. The extraction is inference, and inference is occasionally wrong in ways that produce plausible output.
- Check the row count against something in the document, a stated total or a line count. It catches merged rows and page-break truncation, which are the two common failures.
- Check that numeric columns are numeric. A column that should obviously be numbers arriving as strings means the extraction split or merged a column on some rows.
- Re-derive a total. On an invoice, sum the amounts and compare with the printed total. It is one line of code and it catches nearly everything.
- Look at the last row. A table cut off by a page break stops there, and the truncation is silent.
None of this is a criticism of the extractor specifically. It applies to every PDF table extractor, hosted or local, and any tool that implies otherwise is overselling.
Types, and the header question
Each column is typed once from all of its values, which is the same rule as everywhere else on this site and matters more here because extracted data is noisier. One row where the extraction merged two cells makes that column text, and that is exactly the signal you want.
Where the extracted table has no recognisable header row, the columns are named by position rather than by promoting the first data row into a header. On a document table the first row is often a real data row, and losing it to a guess would be worse than keys called column_1.
Empty cells become null rather than empty strings, and every object carries every key, so the array has one consistent shape that a typed consumer can work with.
Privacy, and encrypted documents
Everything runs in your browser tab: pdf.js reads the document, the extraction runs in the page, and the JSON is produced there. Nothing is uploaded, stored or logged.
An encrypted PDF prompts for its password, which is used locally to decrypt and is not sent anywhere. The documents this page is used on are invoices, statements and filings, which is precisely the category where handing a file and a password to a hosted service is the wrong call.
Frequently Asked Questions
Does it work on a scanned PDF?
No. A scan is an image with no text layer, so there is nothing to infer a table from. You are told when that is what you have rather than being handed an empty array. Extraction works on documents generated by software from real data.
How reliable is the extraction?
Reliable on generated documents with consistent column positions, and unreliable on wrapped cells, merged headers and tables split across page breaks. Treat the output as untrusted input: check the row count, check that numeric columns are numeric, and re-derive a total if the document has one.
Are the keys normalised?
No. They are the extracted header cells exactly as they appeared. Normalising into snake case is a decision with several reasonable answers, and it is one you should make for your own consumer rather than have made for you.
What if the table has no header row?
The columns are named by position. Promoting the first data row into a header would lose a row on a guess, and on a document table the first row is frequently real data rather than a header.
Do empty cells become null?
Yes, and every object still carries every key, so the array has one consistent shape. A missing key and a null value mean different things to a typed consumer, and only one of them reflects what the document says.
Is the document uploaded?
No. pdf.js reads it and the extraction runs inside your browser tab. An encrypted PDF prompts for its password, which is used locally and never sent. Invoices, statements and filings are exactly the category where that matters.
Get the table out of the document
Every table listed, one type per column, and the PDF never leaves your machine.
Back to the converter