Filenary
← Back to all articles

Converting CSV to JSON (and Back) Without a Spreadsheet App

Published 2026-09-10

Exported data rarely comes in the shape you need it. A CSV from a spreadsheet or a database export tool needs to become JSON for an API call or a script, or the reverse — a JSON array from an API response needs to become a spreadsheet someone can actually open.

How CSV to JSON works

The first row of your CSV is treated as column headers, and each following row becomes one JSON object, with the header row supplying the keys. Quoted fields (including ones containing commas or line breaks) are parsed correctly, not just split on every comma.

How JSON to CSV works

Going the other way, it expects a JSON array of flat objects (or a single object, which is wrapped into a one-row array). All the keys across every object are collected to build a consistent header row, so it handles objects with slightly different fields without breaking.

A note on nested data

CSV is fundamentally a flat, tabular format — it doesn't have a native way to represent nested objects or arrays inside a field. If your JSON has deeply nested structures, flatten it first (or export only the fields you need) before converting to CSV.

Steps

  • Open the CSV to JSON (or JSON to CSV) tool.
  • Paste or drop in your data.
  • Review the converted output on screen.
  • Copy it or download it as a file.