CSV转JSON
解析 CSV 文本或文件为 JSON 数组。
关于「CSV转JSON」
它属于「JSON 工具」分类:JSON 的格式化、结构变换与各种数据格式互转。
- 完整支持带引号的字段:引号内的逗号与换行会被正确保留,双写的
""会还原成一个引号。 - 首行为表头时输出对象数组;取消勾选则输出二维数组。
- 自动识别类型会把
123、true、null转成对应的 JSON 类型。 - 为避免破坏数据,像
007这类前导零的编号会保持字符串形式。 - 文件开头的 BOM 会自动去除,不会污染第一个列名。
完全免费、无需注册;所有处理都在浏览器本地完成,文件不会上传到任何服务器。
相关关键词:CSV转JSON、JSON 工具、csv、解析、在线工具、免费
如何使用「CSV转JSON」
- 打开工具:打开「CSV转JSON」页面,无需注册、无需安装任何软件。
- 准备输入:粘贴 CSV 文本,或上传 .csv / .txt / .tsv 文件,按首行表头解析为 JSON 数组。
- 填入内容:把内容粘贴进输入框,或把文件拖入页面;也可以点击「示例」先填入样例数据试一下。
- 设置选项并处理:按需调整页面上的选项,然后点击处理 / 转换 / 生成按钮。
- 获取结果:处理完全在浏览器本地完成,结果可直接复制或下载,文件不会上传到任何服务器。
常见问题
- 带逗号的内容会串列吗?
- 不会。解析器遵循 RFC 4180,只要该字段用双引号包裹,里面的逗号、换行都会被当作普通字符处理。
- 为什么编号 007 没转成数字?
- 这是刻意的保护:转成数字会变成 7,丢失前导零。只有能够无损往返的数值才会被转换,其余保持字符串。
- 支持制表符分隔的 TSV 吗?
- 支持,把分隔符切换为“制表符”即可,其余解析规则完全一致。
- 中文出现乱码怎么办?
- 本工具按 UTF-8 读取文件。如果源文件是 GBK 编码,请先用记事本或 Excel 另存为 UTF-8 格式,或直接把内容复制粘贴到输入框。
CSV to JSON
Parse CSV text or files into a JSON array.
About CSV to JSON
Belongs to “JSON Tools”: Format, transform and convert JSON to and from various data formats.
- Fully supports quoted fields: commas and newlines inside quotes are preserved, and doubled
""becomes a single quote. - First row as header yields an array of objects; uncheck to get a 2D array.
- Auto-detect types converts
123,true,nullto their JSON types. - To avoid data loss, leading-zero codes like
007stay as strings. - A leading BOM is auto-removed so it won’t taint the first column name.
Free, no sign-up; everything runs locally in your browser and files are never uploaded.
Keywords: CSV to JSON, JSON Tools, csv, parse, online tool, free
How to use CSV to JSON
- Open the tool:Open the “CSV to JSON” page — no sign-up and nothing to install.
- Prepare the input:Paste CSV text or upload a .csv / .txt / .tsv file to parse it into a JSON array keyed by the header row.
- 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
- Will comma content break columns?
- No. The parser follows RFC 4180: as long as the field is double-quoted, commas and newlines inside are treated as normal characters.
- Why didn’t 007 become a number?
- Intentional protection: turning it into a number yields 7 and loses the leading zero. Only losslessly round-trippable values are converted; others stay strings.
- Does it support tab-separated TSV?
- Yes — switch the delimiter to “Tab”; all other parsing rules are identical.
- Chinese shows as garbled?
- This tool reads files as UTF-8. If the source is GBK, save it as UTF-8 with Notepad or Excel first, or just paste the content in.