メインコンテンツへスキップ
Z

CSV vs JSON

CSV vs JSON compared — structure, nesting, size and tooling, plus free converters between CSV and JSON.

CSV is a flat, tabular format that spreadsheets and data tools love; JSON is a nested, typed format that code loves. CSV wins for rows-and-columns data; JSON wins when records have nested or varying structure.

CSV vs JSON at a glance

CSV JSON
Structure Flat table (rows × columns) Nested objects & arrays
Types Everything is text Strings, numbers, bool, null
Size Very compact Larger (keys repeated)
Tooling Excel, Sheets, pandas APIs, JS, databases
Nesting Not supported First-class

When to use CSV

Choose CSV for tabular data destined for spreadsheets or data analysis, and for the smallest possible export of flat records.

When to use JSON

Choose JSON when records nest, types matter, or the data feeds an API or application.

Tools for CSV & JSON

CSV vs JSON

ヘッダーにスペースや特殊文字が含まれている場合はどうなりますか?

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>を使用してください。

出力結果をさらに整形(pretty-print)することはできますか?

出力はすでにインデント済みです。別のインデント設定にしたい場合や、圧縮(minify)したい場合は<a class="text-brand-600 hover:underline" href="/xml-formatter">XML Formatter</a>をご利用ください。