Hongmu Notes

JSON to Excel table

Converting JSON to a table flattens structured data into rows and columns: fields into columns and records into rows, which facilitates statistics and verification.
100% Browser local processing 0 Data upload

📥 Conversion settings

💡 Instructions for use

  • Arrays of objects (one object per row) are best for export: field names automatically become table headers, and fields are ordered by first occurrence in each row.
  • The two-dimensional array (one array per row) is spread out in the original order, and the first row is usually used as the field name row; select "No" to not write the field name row.
  • When some rows have fewer fields than other rows, the missing positions are filled with blanks or zeros according to the "How to handle missing fields" setting to avoid misalignment of the entire column.
  • It is recommended to preview before exporting: the preview and exported files use the same data. If the preview is correct, the file content will be consistent.
  • Excel is downloaded in xlsx format and can be opened directly with spreadsheet software; CSV is suitable for importing into a database or script processing.
  • The pasted content is only parsed and generated in the browser, and is not uploaded or saved; you need to paste it again after refreshing the page.

Converting JSON to a table flattens structured data into rows and columns: fields into columns and records into rows, which facilitates statistics and verification.

A key step from structure to two-dimensional table

JSON describes a hierarchical structure, and tables can only express rows and columns. The key point of conversion between the two is "who to choose as columns." The method of this tool is to collect the keys that appear in each row of objects as columns. No matter which record the same batch of data comes from, the meaning of the columns will remain the same; once the rows and columns are fixed, subsequent sorting, filtering, and pivoting can only get the correct results.

Recommended checks before conversion

  • Confirm that the data is an array: a single object cannot form multiple rows.
  • Confirm that the field names are stable: if different key names are used in different records with the same meaning, they will become two columns.
  • Confirm whether there is nesting: process it first if it needs to be expanded, otherwise the nested content will enter the cell as text.

The prerequisite for converting to a table is that the data can be mapped into a row-column relationship: a set of object arrays is most suitable, with the fields of each object becoming columns and each record becoming rows. Data with deeper levels needs to be flattened first.

If the object fields in the array are inconsistent, records with missing fields will be left blank in the corresponding cells instead of being misaligned. This is more reliable than manual splicing, and also facilitates subsequent screening and statistics using table tools.

When there are many fields, it is recommended to delete unused columns before exporting. The table will be cleaner and easier to read.

If the key names of fields with the same meaning are inconsistent, they will become one column each and should be unified before conversion.

📖 Glossary

JSON
A universal data exchange format that uses curly brackets to represent objects and square brackets to represent arrays. It is commonly used in front-end and various interfaces.
object array
It is shaped like an array with one object in each row. The key of the object is the field name. It is most suitable to be directly converted into a table.
two-dimensional array
Each element is also an array of arrays. The position of the element determines which column it falls in. You need to manually confirm the meaning of the column.
Field name row
The first row of the table is used to describe the meaning of each column. The field names of the object array will automatically become this row.
worksheet
A table in an Excel file. One file can contain multiple sheets. This tool exports one sheet at a time.
xlsx
The current Excel file format supports multiple worksheets, styles and data types, and is compatible with mainstream spreadsheet software.
CSV
Comma-separated plain text table format, small in size and easy to be processed by scripts, but does not retain styles and types.
key order
The order in which the fields are arranged from left to right in the table is determined by this tool based on the first occurrence in each row.
Nested objects
When an object or a multi-layered array is embedded in an object, the entire content will be written into the cell as text during export.
Missing fields
For fields that are not found in some rows, leave them blank or fill them with zeros when exporting to avoid misalignment of the entire row.

🔗 All keywords and tutorials

Keywords page of the tool12a

Return to tool home page

❓ FAQ

Can a single object be converted??
Yes, but only one line. It is recommended to put multiple objects into an array before pasting.
Can the order of columns be specified??
The column order is determined based on the first appearance of the fields in each row; when a specific order is required, first adjust the writing order of the keys in the data source.