SwitchPDF

JSON / Array Converter

Paste any JSON or array — preview it as a table, then export to Excel, CSV, or PDF instantly.

Convert any JSON or array — including API responses with nested objects — into Excel, CSV, or PDF instantly. Auto-flattens nested structures, handles arrays of arrays, and renders a live preview so you can verify the output before downloading. Built for developers and data analysts.

How JSON / Array Converter works

JSON-to-spreadsheet conversion sounds simple but real-world JSON is messy. API responses come as arrays of objects, single objects, nested objects, arrays of arrays, and combinations. SwitchPDF's converter handles all of these by walking the JSON tree, flattening nested objects with dot notation, and joining array values into comma-separated cell values.

Flattening means an object like { "address": { "city": "NYC", "zip": "10001" } } becomes two columns: address.city and address.zip. This preserves all the data while producing a flat tabular structure that works in Excel or CSV. Top-level arrays of objects become rows; a single object becomes a one-row spreadsheet; primitive values are placed in a "value" column.

The Excel export uses SheetJS to produce a real .xlsx file (not a CSV renamed). The CSV export properly escapes commas, quotes, and newlines using RFC 4180 quoting. The PDF export uses pdf-lib to generate a paginated table with a styled header row, alternating row colors, and automatic column-width calculation based on content. All three exports happen server-side in milliseconds — no JavaScript table-rendering libraries needed in the browser.

This tool is especially useful for: exporting API responses to Excel for non-technical stakeholders; turning a JSON dataset into a CSV for import into Google Sheets; producing a formatted PDF table from a JSON config for inclusion in a report; debugging the structure of a complex JSON response by visualizing it as a table.

How to use JSON / Array Converter

1

Paste or upload your JSON

Paste a JSON array or object directly, or upload a .json file. The input is parsed and validated in real time.

2

Preview the data table

Your JSON appears as a table with auto-detected columns. Nested objects are flattened using dot notation.

3

Choose export format and download

Pick Excel, CSV, or PDF. Click Convert and download the file immediately.

Frequently Asked Questions

What JSON formats are supported?
+
Arrays of objects, single objects, nested objects (which get flattened), arrays of primitives, and any combination. Invalid JSON produces a clear error message.
How are nested objects handled?
+
They're flattened using dot notation. { "user": { "name": "Alice", "city": "NYC" } } becomes columns "user.name" and "user.city".
How are arrays inside objects handled?
+
Arrays of primitives are joined as comma-separated strings. Arrays of objects are stringified as JSON in the cell — handle them upstream if you need them as rows.
Can I import the CSV into Google Sheets?
+
Yes. Download the CSV, then in Google Sheets: File → Import → Upload the CSV file. The import dialog will detect the columns automatically.
What's the size limit?
+
Up to 10 MB of JSON input. Large datasets convert in 1–3 seconds; multi-MB datasets may take a few extra seconds.
Will my JSON be sent to your server?
+
Yes — the conversion happens server-side. The data is processed in memory and discarded immediately after the response. Nothing is logged or persisted beyond the 15-minute output file lifetime.
Can I customize the PDF title?
+
Yes. There's a "title" field that becomes the header of the PDF document. Defaults to "Data Export" if blank.
Is the JSON converter free?
+
Yes, completely free. No sign-up required. Rate-limited to 20 PDF exports / 30 spreadsheet exports per 15 minutes per visitor.

Related tools