JSON ↔ CSV Converter

Convert between JSON arrays and CSV. Handles nested objects with dot notation and quoted CSV fields.

Output will appear here…

What the converter does

Two directions, one page: turn an API response into something a spreadsheet will open, or turn an exported sheet back into JSON. Both run in the browser, so customer exports do not leave your machine.

  • Swap — flip the direction without retyping anything.
  • Sample — loads a worked example for whichever direction is active.
  • Row and column counts — a quick check that every record survived.
  • RFC 4180 quoting — commas, quotes, and newlines inside values are escaped on the way out and understood on the way in.
  • Copy — takes the whole output.

How nesting becomes columns

CSV is flat and JSON is not, so nested objects are flattened into dot-notation headers. Note that columns come out sorted alphabetically, not in the order the keys appeared:

JSON in

[
  {
    "id": 1,
    "name": "Alice",
    "address": {
      "city": "NYC",
      "zip": "10001"
    }
  }
]

CSV out

address.city,address.zip,id,name
NYC,10001,1,Alice

Rows with different keys are unioned, so a field missing from one record becomes an empty cell rather than a shifted column.

When you need this

  • Handing an API response to someone who works in Excel or Google Sheets.
  • Loading data into a tool that only ingests CSV — most BI imports, many bulk uploaders.
  • Going the other way: turning a spreadsheet of test data into fixtures or a seed file.
  • Eyeballing a long list of records as a table instead of scrolling nested braces.

Limitations worth knowing

  • Column order is alphabetical. Convenient for diffing two exports, surprising if you expected key order preserved.
  • Arrays are not expanded. tags: ["a", "b"] becomes one quoted cell, "a,b", not two columns.
  • CSV to JSON produces strings. 1 comes back as "1", because a CSV cell carries no type.
  • Dot notation does not round-trip. A header of address.city becomes a flat key with a dot in its name, not a nested object again.
  • Nulls become empty cells. On the way back they are empty strings, so null and “” are no longer distinguishable.

Related JSON tools

Frequently Asked Questions

What shape does my JSON need to be?

A top-level array of objects — the same thing an API list endpoint returns. A bare object or a number is rejected, since there are no rows to build from.

How are nested objects handled?

They are flattened with dot notation, so { address: { city: "NYC" } } becomes a column called address.city. Arrays are not expanded into columns; they land in one cell as a comma-joined string.

Does it handle commas and quotes inside fields?

Yes, in both directions. Values containing a comma, quote, or newline get wrapped in quotes with inner quotes doubled, and the CSV parser reads that convention back correctly.

Are numbers still numbers after CSV to JSON?

No. CSV carries no type information, so every value comes back as a string. Cast the columns you care about after converting.

Is there a row limit?

No hard limit — it runs in your browser, so the ceiling is your machine. Tens of thousands of rows is comfortable, and no data is uploaded.