My manager walked up to my desk on a Tuesday morning with a request that still haunts me: "Can you export these API logs to CSV so the analytics team can open them in Excel?" The logs were 15,000 lines of deeply nested JSON. My first thought was to write a Python script. My second thought was "I have a meeting in 20 minutes." That's when I discovered I didn't need to write any code at all.

The Problem With JSON and Spreadsheets

JSON is great for machines. It's hierarchical, flexible, and self-describing. CSV is great for humans. It's flat, tabular, and opens in any spreadsheet app. The problem is that JSON doesn't map neatly to CSV without losing information.

Take this record from the API logs:

{
  "request": {
    "method": "GET",
    "path": "/api/users",
    "headers": {
      "content-type": "application/json",
      "authorization": "Bearer tok_abc123"
    }
  },
  "response": {
    "status": 200,
    "latency_ms": 145,
    "body": {
      "users": [
        { "id": 1, "name": "Alice" },
        { "id": 2, "name": "Bob" }
      ]
    }
  },
  "timestamp": "2026-06-01T10:30:00Z"
}

A single JSON record here contains nested objects (request, response), nested arrays (response.body.users), and nested objects within arrays. How do you flatten that into a row of a CSV?

How Online Converters Handle Flattening

Good JSON-to-CSV converters use a strategy called dot-notation flattening. Each nested path becomes a column header.

request.methodrequest.pathrequest.headers.content-typerequest.headers.authorizationresponse.statusresponse.latency_mstimestamp
GET/api/usersapplication/jsonBearer tok_abc1232001452026-06-01T10:30:00Z

Notice what happens to response.body.users — that's an array. Arrays can't fit into a single column, so converters have two strategies:

Strategy 1: Duplicate rows. Each element in the array gets its own row, with all parent fields duplicated. This gives you:

request.methodresponse.statusresponse.body.users.idresponse.body.users.name
GET2001Alice
GET2002Bob

This is usually what you want if you're analyzing array data.

Strategy 2: JSON-encode the array. The entire array gets stuffed into a single cell as a JSON string. It's ugly but lossless.

I always use Strategy 1. It makes the CSV immediately usable in pivot tables and charts. If you need to work with the flattened data across multiple formats, check out /blog/jsonformatter--json-to-yaml-conversion-guide for YAML equivalents.

Using the Online Tool: Step by Step

Here's exactly what I did with those 15,000 API logs:

  1. Went to DevFormatters JSON formatter
  2. Pasted the JSON array (all 15,000 records)
  3. Selected CSV as the output format
  4. Clicked export
  5. Opened the CSV in Excel

Total time: about 3 minutes, mostly waiting for the file to download. No Python scripts to debug. No pandas installation issues. No wondering whether I handled the edge cases correctly.

request.method,request.path,response.status,response.latency_ms,timestamp
GET,/api/users,200,145,2026-06-01T10:30:00Z
POST,/api/orders,201,230,2026-06-01T10:31:00Z
GET,/api/products,200,89,2026-06-01T10:32:00Z

The CSV I got back had 48 columns from the deeply nested JSON. Every nested field became a column. Arrays expanded into multiple rows. The analytics team could immediately filter, sort, and chart the data without asking me to "run another export."

For when you need to do the reverse operation, our guide on convert json to typescript interfaces shows how to turn API outputs into typed code.

When the Nested JSON Gets Complicated

Not all JSON flattens cleanly. Here are the cases I've hit and how to handle them:

Variable-depth nesting: Some JSON trees go 5 levels deep, others go 2. Converters flatten everything to the deepest level. Shallow records get empty cells — which is correct behavior.

Arrays of arrays: "coordinates": [[1,2], [3,4], [5,6]] — most converters can't expand this meaningfully. They'll either JSON-encode the whole array or skip it.

Inconsistent keys: If record 1 has "details": {"color": "red"} and record 2 has "details": {"size": "large"} — you'll get both details.color and details.size columns. Records fill in what they have and leave the rest blank.

Mixed types in the same field: A field that's sometimes a string and sometimes an object will cause problems. Ideally you clean this up in the JSON before converting.

[
  { "name": "Product A", "variants": ["small", "large"] },
  { "name": "Product B", "variants": ["red", "blue", "green"] }
]

Becomes:

namevariants
Product Asmall
Product Alarge
Product Bred
Product Bblue
Product Bgreen

This duplication of name is fine for analysis but means the CSV is no longer normalized. Each row is a flat data point.

Why Not Just Write a Script?

I'm a developer. My default solution is always code. But here's why I now use online tools for this:

One-time exports: Writing a script for a one-time export takes 15 minutes. The tool takes 3. That's 12 minutes I can spend on actual engineering.

No dependency hell: My Python script needs json, csv, and probably pandas for complex flattening. If pandas isn't installed or the wrong version is, I'm debugging packaging instead of exporting data.

Non-developer accessibility: My analytics team now uses the tool directly. They paste JSON, get CSV, and never need to ask me to write a script.

Visual verification: With the tool, I can see the flattened structure before downloading. With a script, I have to run it and check the output file.

If you're working alongside Java or Python teams, json to java pojo python dataclass shows how the same JSON becomes different class definitions.

FAQ

Q: Can I convert JSON to CSV without coding?

A: Yes. Online tools like DevFormatters let you paste JSON and download CSV instantly with no scripts.

Q: How does the tool handle nested JSON objects?

A: Nested objects are flattened using dot notation. Each nested path becomes a column header (e.g., user.address.city).

Q: What happens to arrays inside JSON?

A: Arrays either expand into multiple rows (duplicating parent fields) or get encoded as JSON strings in a single cell, depending on the tool.

Q: Does it support large JSON files?

A: Most online tools handle files up to a few MB. For very large files, you may need to split the JSON into chunks.

Q: Can I convert an array of JSON objects to CSV?

A: Yes, that's the most common use case. Each object in the array becomes one or more rows in the CSV.

Q: What about special characters and commas in the data?

A: Proper converters escape commas and wrap fields in quotes. Always check the output CSV for proper formatting.

Q: Can I choose which fields to include in the CSV?

A: Basic converters include all fields. Some advanced tools let you select specific paths to include or exclude.

Q: Is the conversion lossless from JSON to CSV?

A: No. CSV is less expressive than JSON. You lose type information, and complex nested structures may be simplified or duplicated across rows.