JSON转CSV
对象数组转为 CSV 表格并下载。
关于「JSON转CSV」
它属于「JSON 工具」分类:JSON 的格式化、结构变换与各种数据格式互转。
- 输入需要是对象数组,表头由所有对象键名的并集自动生成。
- 勾选展开嵌套字段后,
{"a":{"b":1}}会变成列a.b,避免整段 JSON 挤在一个单元格里。 - 含逗号、引号或换行的内容会自动加引号转义,符合 RFC 4180 规范。
- BOM 是给 Excel 认中文用的:不加的话用 Excel 直接打开可能出现乱码。
- 某些对象缺少的字段会在对应单元格留空,不会导致列错位。
完全免费、无需注册;所有处理都在浏览器本地完成,文件不会上传到任何服务器。
相关关键词:JSON转CSV、JSON 工具、csv、表格、导出、在线工具、免费
如何使用「JSON转CSV」
- 打开工具:打开「JSON转CSV」页面,无需注册、无需安装任何软件。
- 准备输入:粘贴对象数组 JSON 或上传文件,按字段名转为 CSV 表格并下载。
- 填入内容:把内容粘贴进输入框,或把文件拖入页面;也可以点击「示例」先填入样例数据试一下。
- 设置选项并处理:按需调整页面上的选项,然后点击处理 / 转换 / 生成按钮。
- 获取结果:处理完全在浏览器本地完成,结果可直接复制或下载,文件不会上传到任何服务器。
常见问题
- 为什么要加 BOM?
- Excel 打开 CSV 时不会自动识别 UTF-8,默认按系统本地编码解析,中文就会变成乱码。文件开头加上 BOM 标记后,Excel 就能正确识别为 UTF-8。用其它工具处理时可以不加。
- 嵌套对象怎么处理?
- 勾选“展开嵌套字段”会把层级摊平成
a.b.c形式的独立列;不勾选则把整个子对象序列化成 JSON 字符串塞进一个单元格。 - 各行字段不一样会怎样?
- 表头取所有对象键名的并集,某行没有的字段会留空,因此不会出现列数不齐的问题。
- 分隔符该选哪个?
- 中文 Windows 的 Excel 有时默认按分号分列,如果打开后所有内容挤在一列,可以改用分号或制表符再试。
JSON to CSV
Convert an array of objects into a downloadable CSV.
About JSON to CSV
Belongs to “JSON Tools”: Format, transform and convert JSON to and from various data formats.
- Input must be an array of objects; the header is auto-built from the union of all keys.
- With flatten nested,
{"a":{"b":1}}becomes columna.b, avoiding a whole JSON blob in one cell. - Content with commas, quotes or newlines is auto-quoted per RFC 4180.
- BOM lets Excel read Chinese correctly; without it, opening in Excel may show mojibake.
- Fields missing from some objects leave blank cells, never shifting columns.
Free, no sign-up; everything runs locally in your browser and files are never uploaded.
Keywords: JSON to CSV, JSON Tools, csv, table, export, online tool, free
How to use JSON to CSV
- Open the tool:Open the “JSON to CSV” page — no sign-up and nothing to install.
- Prepare the input:Paste an array of objects as JSON or upload a file to convert it into a CSV table by field name and download it.
- Provide the input:Paste your content into the input box or drop a file onto the page; you can also click “Sample” to try example data first.
- Adjust options and run:Adjust the options if needed, then click the process / convert / generate button.
- Get the result:Everything runs locally in your browser; copy or download the result — your files are never uploaded.
FAQ
- Why add a BOM?
- Excel does not auto-detect UTF-8 when opening CSV, defaulting to the system locale, which garbles Chinese. A leading BOM makes Excel recognize UTF-8. Other tools don't need it.
- How are nested objects handled?
- Flatten nests into columns like
a.b.c; otherwise the whole sub-object is serialized as a JSON string in one cell. - What if rows have different fields?
- The header is the union of all keys; missing fields become blanks, so column counts stay consistent.
- Which delimiter should I pick?
- Chinese Windows Excel sometimes splits on semicolons by default; if everything lands in one column, try semicolon or tab.