← All guides

How to Convert CSV to JSON (and Back)

Quick answer: open the free CSV ⇄ JSON Converter, drop in your CSV, and click Convert. Each row becomes a JSON object whose keys are your column headers, output as a pretty-printed array. Switch the direction to convert JSON back to CSV.

What the output looks like

Given this CSV:

name,email,plan
Ada,ada@example.com,pro
Lin,lin@example.com,free

the converter produces:

[
  { "name": "Ada", "email": "ada@example.com", "plan": "pro" },
  { "name": "Lin", "email": "lin@example.com", "plan": "free" }
]

This array-of-objects shape is what most APIs, NoSQL databases (like MongoDB imports) and JavaScript applications expect.

Step by step

  1. Open the CSV ⇄ JSON Converter.
  2. Make sure the direction is CSV → JSON and drop in your file. The first row is used as the keys.
  3. Click Convert and download the .json file.

For the reverse, choose JSON → CSV and drop in a JSON file containing an array of objects. Keys become column headers; objects become rows. If your objects have different keys, the columns are unified automatically.

Things to know

Cleaning data before converting it usually pays off: remove duplicate rows first, merge multiple exports into one file, or split a huge CSV into manageable parts.