Skip to content
SocialTools

CSV ↔ JSON Converter

Switch between CSV → JSON and JSON → CSV; the first CSV row becomes the object keys.

Runs in your browser. Nothing you enter is uploaded.

What it does

In CSV → JSON mode, the first row is read as headers and every following row becomes an object with those headers as keys. In JSON → CSV mode, an array of objects (or a single object) becomes a CSV table, with columns built from every key found across all records.

The parser follows standard CSV quoting, so fields wrapped in double quotes can contain commas, line breaks and doubled quotes. That makes it safe for spreadsheet exports with addresses or free-text notes in them. Conversion happens in the page as you type, with no file upload step.

How to use it

  1. 1

    Click CSV → JSON or JSON → CSV at the top.

  2. 2

    Paste your data into the input box (a sample CSV is preloaded so you can see the format).

  3. 3

    Check for a red error message; otherwise the output panel fills in automatically.

  4. 4

    Click Copy output to copy the result.

  5. 5

    Optionally click Use output as input to load the result and switch direction.

What you get

CSV → JSON produces a two-space indented JSON array of objects with every value as a string. JSON → CSV produces comma-separated text with a header row, quoting any field that contains a comma, quote or line break.

When to use it

Seed test data from sheets
Export a Google Sheet as CSV, convert it, and paste the JSON array into a fixture file or mock API.
Open API data in Excel
Paste a JSON array of records in JSON → CSV mode and save the output as a .csv file to open in a spreadsheet.
Merge records with different fields
When some objects have extra keys, JSON → CSV adds a column for each key and leaves the cell empty where a record lacks it.
Round-trip a quick edit
Use output as input flips the mode and loads the result, so you can convert, adjust, and convert back.

Example

Input

name,email,role
Alice,alice@example.com,admin

Output

[
  {
    "name": "Alice",
    "email": "alice@example.com",
    "role": "admin"
  }
]

In reverse, {"name":"Alice","note":"Says \"hi\", often"} becomes a CSV line where the note is wrapped in quotes and its inner quotes are doubled.

Tips

  • Only commas are treated as delimiters. For semicolon or tab-separated exports (common from European Excel settings), change the delimiter to commas before pasting.
  • All CSV values come out as strings, including numbers and true or false. Convert types in your code if the API expects numbers.
  • Nested objects are not flattened in JSON → CSV: an object value becomes the text [object Object], while an array becomes its items joined with commas. Flatten nested data before converting.
  • A blank header cell becomes a key like column_3, and rows that are completely empty are skipped.

Questions

Does the converter handle commas inside a CSV field?

Yes, as long as the field is wrapped in double quotes, which is how Excel and Google Sheets export it. Quoted fields can also contain line breaks, and a doubled quote ("") inside them becomes a single quote character.

What JSON shape does JSON → CSV need?

An array of flat objects works best. A single object is treated as one row. Arrays of plain values such as ["a","b"] have no keys, so the tool reports "No object keys found in JSON".

Why are my numbers in quotes after converting CSV to JSON?

CSV has no data types, so every cell is kept as text. If you need numbers or booleans, map the fields after importing, or edit the JSON before using it.

What happens when rows have more cells than headers?

Extra cells beyond the header count are dropped. Rows with fewer cells get empty strings for the missing columns.