How to Convert CSV to JSON (Step by Step)
Convert a CSV file or text into JSON in your browser — step by step, with a free CSV to JSON converter.
Turning tabular CSV into nested JSON is a one-step job:
-
1
Open the converter
Open the CSV to JSON tool.
-
2
Paste your CSV
Paste your CSV (including the header row) into the input.
-
3
Get JSON
Each row becomes a JSON object keyed by the header. Copy or download the result.
Do it now
常见问题
如果标题中包含空格或特殊字符怎么办?
这些字符会被替换为下划线,因为 XML 元素名不能包含它们。以数字开头的标题会自动添加前缀 `_`。
需要不同的 XML 结构(用属性而非子元素表示)怎么办?
可以先用 <a class="text-brand-600 hover:underline" href="/csv-to-json">CSV to JSON</a> 将 CSV 转为 JSON,编辑该 JSON,然后使用 <a class="text-brand-600 hover:underline" href="/json-to-xml">JSON to XML</a> 并设置属性前缀(attribute prefix)。
可以让输出结果的格式更美观吗?
输出结果已经过缩进处理。如需不同的缩进方式或想要压缩(minify),可以使用 <a class="text-brand-600 hover:underline" href="/xml-formatter">XML Formatter</a>。