Hongmu Notes

JSON to Excel CSV

JSON to CSV outputs a plain text table: small in size and easy to search, suitable for importing into a database or handing it over to a script for processing.
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.

JSON to CSV outputs a plain text table: small in size and easy to search, suitable for importing into a database or handing it over to a script for processing.

Advantages and Costs of CSV

CSV writes all content as plain text, and is easier than binary tables to be distinguished by version management tools, retrieved by command line tools, and read line by line by scripts. Therefore, it is commonly used in the data cleaning and warehousing stages. The price is that there is no type and style information: the date may become an ordinary string, content containing commas or newlines needs to be processed by quotation mark wrapping rules, and the import tool must correctly recognize quotation marks, otherwise the columns will be misaligned.

Things to note when using CSV

  • Fields containing commas, quotes, or newlines are quoted, which is standard practice and not an exception.
  • The encoding mark has been added when exporting, and Chinese will not be easily garbled when opened by common spreadsheet software.
  • CSV is preferred when reprocessing is required, and xlsx is used when finished products need to be delivered.

The advantage of plain text format is that it is versatile and can be read by almost all tools. When importing Chinese, it is recommended to choose an encoding with a byte order mark, otherwise some spreadsheet software will display garbled characters when opened.

If the field contains commas, quotation marks or newlines, it will be automatically wrapped in quotation marks and escaped during export. After manually modifying the export file, it is recommended to import and verify it again to confirm that the number of columns has not been destroyed.

If the downstream system only accepts encoding without tags, you can use the tool to convert it again after exporting.

CSV is used for data cleaning and warehousing, and xlsx is used for the finished product for human viewing.

📖 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 I customize the delimiter??
Currently exported by standard comma. If you need other separators, just use the text tool to replace them in batches after exporting.
What should I do if CSV opens with Chinese garbled characters??
The exported file has been marked with encoding; if it is still garbled, use the "Import" of the spreadsheet software and manually specify the UTF-8 encoding.