ModernCalcs

JSON to Excel Converter

3 rows × 4 columns

Input must be a JSON array of objects. JSON keys become column headers. Nested objects are dot-flattened (e.g., address.city) when the flatten option is enabled. Arrays within objects are JSON-stringified.

JSON to Excel Converter: Turn API Responses into Spreadsheets

REST APIs return JSON arrays of objects — the natural format for lists of records. Stakeholders want spreadsheets. This converter takes a JSON array, uses the object keys as column headers, and produces a downloadable .xlsx workbook. Nested objects are dot-flattened so deeply nested API responses produce readable tabular data.

Formula
JSON input: [ { "name": "Alice", "age": 30, "address": { "city": "NYC" } }, { "name": "Bob", "age": 25, "address": { "city": "LA" } } ] → Excel with flatten enabled: name | age | address.city Alice | 30 | NYC Bob | 25 | LA

Dot-flattening expands nested objects: {"a": {"b": 1}} → column name "a.b". Arrays in objects are stringified.

Handling API Responses

API responses often have nested objects — a user record might have a nested address, metadata, or permissions object. Flattening these is essential for tabular display. The converter uses dot notation (address.city, meta.created_at) to name the flattened columns, matching how tools like pandas and jq represent nested paths.

Type Preservation vs CSV

Going JSON → Excel directly preserves types better than JSON → CSV → Excel. Numbers stay numbers, booleans stay booleans. Going through CSV would stringify everything, then Excel would re-infer types (imperfectly). Direct JSON-to-xlsx conversion skips the lossy CSV intermediate step.

Large JSON Datasets

This converter processes everything in the browser — no upload needed, but all data is in browser memory. For typical API responses (thousands of rows), this is fast. For very large files (100k+ rows), browser memory may be a constraint. In that case, use a server-side tool or Python's openpyxl/pandas for batch processing.

What the Converter Handles

  • JSON array of objects → Excel rows
  • Object keys → column headers
  • Nested objects → dot-flattened columns (optional)
  • Arrays in objects → JSON-stringified cell
  • JSON types preserved: string, number, boolean, null

Frequently Asked Questions

What JSON format is expected?

The input must be a JSON array of objects: [{...}, {...}, ...]. Each object becomes one row. The keys of the objects become column headers. All objects should have the same keys for consistent columns — missing keys in some objects produce empty cells for that row.

What does 'flatten nested objects' do?

Nested objects like { "address": { "city": "NYC", "zip": "10001" } } would produce a single 'address' column containing a JSON string, which is not useful. With flattening enabled, the nested object is expanded: 'address.city' and 'address.zip' become separate columns. This makes nested API response data much more usable in a spreadsheet.

How are arrays inside objects handled?

Arrays within JSON objects (not the top-level array of rows) are JSON-stringified into a single cell value. For example, {"tags": ["a", "b"]} becomes a cell containing ["a","b"]. There is no automatic expansion of inner arrays into multiple columns or rows — that would require knowing how many elements each array has in advance.

Are JSON types preserved in Excel?

Yes. JSON strings become text cells, JSON numbers become Excel numbers, JSON booleans become the text 'true'/'false'. JSON null becomes an empty cell. This is more type-faithful than going through CSV, which stores everything as strings.