RevealTheme logo

JSON转CSV转换工具

将由对象组成的JSON数组转换为CSV格式。非常适合将API数据导出到电子表格。

如何使用本工具

  1. 1

    Paste or type a JSON array of objects into the text box. The array must be non-empty (for example: [{"name":"A","value":1}]).

  2. 2

    Click the Convert button to generate the CSV.

  3. 3

    Read the CSV in the output panel below the button, with the header row first followed by one row per object.

  4. 4

    Select the output text and copy it into a spreadsheet, a .csv file, or wherever you need it.

什么是JSON转CSV转换工具?

JSON是API的通用格式;CSV是电子表格的通用格式。在二者之间转换是一项常见任务:将分析数据导出到Excel、将CSV数据导入JavaScript应用等。本工具能很好地处理由扁平对象组成的数组;深度嵌套的结构可能需要预处理。

常见使用场景

  • Turning a small JSON response from an API into a CSV you can paste straight into Excel or Google Sheets.

  • Quickly eyeballing tabular API data as rows and columns instead of nested braces.

  • Preparing a CSV for a bulk-import feature that expects flat columns, when your source data is already a uniform JSON array.

  • Converting a JSON fixture or seed file into CSV for a quick import into a database GUI.

  • Generating a CSV snippet for documentation or a bug report without installing jq or writing a script.

  • Sanity-checking that a JSON array has consistent keys across records by spotting blank or missing cells in the output.

常见问题

如果我的JSON包含嵌套对象会怎样?
本工具会将嵌套的值转换为CSV单元格内的字符串。对于复杂结构,请先用jq之类的工具将其扁平化。
它能处理特殊字符吗?
可以:值中的逗号和引号会按照RFC 4180被正确转义。

相关工具