Convert JSON to PDF Online
Make a printable PDF table from a JSON array, with the keys as the header row. The JSON is parsed in your browser and never uploaded.
Drop a CSV or Excel file here
CSV · XLSX · XLS · XLSM · XLSB
Ready to download as a binary file.
How to convert JSON to PDF
Three steps from members.json to a PDF.
1. Paste the JSON
Paste JSON or drop a .json file. Arrays, keyed objects and JSON Lines all work.
2. Check it in the grid
Remove columns you don't want on paper, especially nested JSON, and keep the column count low enough for the page width.
3. Download PDF
Pick Portrait or Landscape and click Download PDF. data.pdf is generated in your browser.
Example: JSON in, PDF out
A member list exported from an app, with dates and booleans.
[
{ "member": "Ines Duarte", "plan": "Annual", "since": "2021-03-14", "active": true },
{ "member": "Liam Walsh", "plan": "Monthly", "since": "2023-11-02", "active": false }
]| member | plan | since | active |
|---|---|---|---|
| Ines Duarte | Annual | 2021-03-14 | true |
| Liam Walsh | Monthly | 2023-11-02 | false |
Every value is printed as text: the dates as written and the booleans as true and false.
What changes between JSON and PDF
Page layout
The table is drawn on A4 pages, portrait or landscape. The header row (member, plan, since, active) is printed as a coloured table head and repeated at the top of every page; body rows are striped.
Text, not an image
Values are printed as text, as they appear in the grid, so the PDF can be searched and copied from. Long values wrap inside their column and widths are set automatically.
Not everything stays typed
true and false become the words true and false, null becomes an empty cell, and that is how they reach the PDF.
When to convert JSON to PDF
- Sharing API or log data with someone who needs a document, not a file to parse.
- Printing a list exported from an app: orders, members, tickets.
JSON to PDF in JavaScript
JSON needs no parser: JSON.parse gives you the data. Then jsPDF and jspdf-autotable, the libraries this page uses, draw the table.
import { writeFile } from 'node:fs/promises';
import { readFile } from 'node:fs/promises';
import { jsPDF } from 'jspdf';
import { applyPlugin } from 'jspdf-autotable';
const items = JSON.parse(await readFile('members.json', 'utf8'));
const toText = (v) => (v == null ? '' : typeof v === 'object' ? JSON.stringify(v) : String(v));
const header = [...new Set(items.flatMap((o) => Object.keys(o)))];
const rows = items.map((o) => header.map((key) => toText(o[key])));
applyPlugin(jsPDF); // adds doc.autoTable()
const doc = new jsPDF({ orientation: 'landscape' });
doc.autoTable({ head: [header], body: rows.map((row) => header.map((_, i) => String(row[i] ?? ''))) });
await writeFile('members.pdf', Buffer.from(doc.output('arraybuffer')));TabularJS reads spreadsheet files, not JSON; JSON.parse is all JSON needs.
Frequently asked questions
Is there a row limit?
No fixed limit: the table continues onto new pages with the header repeated. Very large arrays take longer because the PDF is built in your browser.
Can nested JSON print as a readable table?
Not directly: a nested value prints as JSON text in one cell. Flatten the objects first, so that each field you want gets its own column.
Why do I get “This JSON doesn’t contain a table”?
The JSON is valid, but no table was found in it: for example a single object of plain values, or an array of strings. Wrap your objects in an array, or paste the array part of the response.
Is the header repeated on each page?
Yes. When the table runs over more than one page, the header row is printed again at the top of each page.
Does members.json get uploaded when I convert it to PDF?
No. The JSON is parsed in your browser and never uploaded.