QCSunny Lab

CSV ⇄ JSON ConverterCSV 与 JSON 互转工具

Output转换输出

Convert CSV to JSON — the first row becomes the header and each later row an object — or turn a JSON array of objects back into CSV. Both directions speak full RFC 4180: quoted fields, doubled quotes, commas and newlines inside values.

Validation is strict by design: duplicate headers, ragged rows and unterminated quotes are rejected with the exact row and column counts, so data problems surface here instead of silently corrupting a downstream import.

Frequently asked questions

Are numbers kept as numbers?

CSV has no types — every cell stays a string in the JSON output. Cast in your own code, or post-process the JSON.

What if a JSON row has extra keys?

The header comes from the first object; extra keys in later rows are ignored, missing ones become empty cells.

Does it handle Excel exports?

Yes for standard CSV exports; .xlsx is a binary format and needs to be saved as CSV first.

中文说明

CSV 转 JSON——首行作表头、后续每行成一个对象;也可把 JSON 对象数组转回 CSV。两个方向都完整支持 RFC 4180:带引号字段、双写引号、值内的逗号与换行。

校验刻意从严:表头重复、行长不齐、引号未闭合都会连同精确的行列数一起报错,让数据问题在这里暴露,而不是悄悄污染下游导入。

常见问题

数字会保持数字类型吗?

CSV 本身没有类型——JSON 输出里每个单元格都是字符串,请在自己的代码里转换,或对 JSON 做后处理。

JSON 某行多了字段怎么办?

表头取自第一个对象;后续行的多余字段被忽略,缺失字段输出为空单元格。

能处理 Excel 导出的文件吗?

标准 CSV 导出可以;.xlsx 是二进制格式,请先另存为 CSV。