跳转到主要内容

JSON 转 CSV 转换器

在浏览器中即时将 JSON 对象数组转换为 CSV 格式。

Input
0 chars | 0 bytes
Output
0 chars | 0 bytes

Most REST APIs return data as JSON arrays of objects, but the tools used to analyse, share, or import that data — spreadsheets, BI dashboards, ETL pipelines — expect CSV. Manually extracting columns is tedious and error-prone, especially when the array has dozens of keys or inconsistently present optional fields.

This converter accepts a JSON array, detects all unique keys across every object, and emits a correctly quoted CSV with a header row. It handles missing values gracefully, fills nested objects as JSON strings rather than silently dropping them, and gives you a file you can drag straight into Excel, Google Sheets, or your data pipeline. Useful for API prototyping, report generation, and one-off data migrations.

如何在线将 JSON 转换为 CSV

  1. 1

    粘贴 JSON 数组

    粘贴一个 JSON 对象数组。工具验证输入,如果格式不是 JSON 数组则显示清晰的错误信息。

  2. 2

    查看列标题

    数组的键成为 CSV 列标题。嵌套对象以点号表示法键名展平。展平时会显示警告。

  3. 3

    复制或下载 CSV

    复制 CSV 输出,或下载为 .csv 文件,可直接在 Excel、Google 表格或任何数据工具中使用。

How JSON-to-CSV Conversion Works

The converter first validates that the input is a JSON array of objects, then performs a union of all keys across every element — essential when the API returns objects with optional fields that are absent in some records. This union becomes the CSV header row, and every object is then serialised in header order, substituting an empty string for absent keys.

Values require careful handling during serialisation. Strings that contain commas, double quotes, or newlines must be wrapped in double quotes, with embedded double quotes doubled per RFC 4180. Numbers and booleans are written as literals. Nested objects and arrays cannot be flattened automatically without losing information, so they are serialised as compact JSON strings — clearly marked so downstream consumers know to parse them further if needed.

为什么使用 FileCrank JSON 转 CSV?

  • ✓ 将 JSON 数组转换为 CSV,键名作为列标题。
  • ✓ 自动使用点号表示法展平嵌套对象。
  • ✓ 可切换为 CSV 转 JSON 方向而不丢失输入内容。
  • ✓ 完全在浏览器中运行——不向任何服务器发送数据。

功能与规格

最大文件大小
最大 100 MB
隐私
文件在约一小时后删除
价格
免费,无需注册
处理方式
100%客户端
剪贴板支持
One-click copy to clipboard
您的数据永不离开浏览器——所有处理均在本地完成。无需注册账户。免费使用,无限制。

常见问题

哪种 JSON 结构可以转换为 CSV?

输入必须是每个对象具有相同键的 JSON 对象数组。如果对象的键不一致,缺失值留空。基本类型和非对象数组无法转换。

嵌套的 JSON 对象如何处理?

嵌套对象使用点号表示法展平。{"user": {"name": "Alice"}} 将成为名为 user.name 的列。对象内的数组将在单元格中转换为 JSON 字符串。展平时会显示警告。

输出的 CSV 是否包含标题行?

是的。CSV 输出的第一行始终是标题行,由 JSON 数组第一个对象的键生成。

可以在不丢失数据的情况下从 JSON 转 CSV 切换到 CSV 转 JSON 吗?

可以。使用方向切换按钮来切换工具。您的输入将保留在新工具的输入面板中。

Browser Converter vs. jq + csvkit vs. ETL Tools

The `jq` and `csvkit` combination is powerful in a pipeline but requires shell access and knowledge of both tools' syntax. Full ETL platforms like Airbyte or Fivetran are designed for recurring scheduled loads, not quick one-off conversions. A browser converter is the right tool when you have a JSON payload in hand right now and need a CSV in the next thirty seconds — no environment to set up, no commands to remember.

FileCrank JSON 转 CSV 转换器将 JSON 对象数组转换为 CSV 表格,对嵌套结构使用点号表示法展平,完全在浏览器中运行。

Advertisement

Ad