DeveloperApr 24, 20266 min read

How to Convert JSON to CSV Online (Free, No Data Mangling)

An API gives you JSON. Your marketing team wants Excel. Your analyst asks for a spreadsheet. Your finance lead insists on a pivot table. JSON-to-CSV conversion sits at the seam between engineering and every other department — and it's where a lot of data quietly breaks. Nested objects get mangled, commas slip into string fields, Excel silently eats leading zeros, and suddenly the numbers don't add up. Here's how the conversion actually works, the gotchas that cause real-world bugs, and how to do it privately in your browser.

Why Converting JSON to CSV Is Trickier Than It Looks

JSON is a tree; CSV is a table. A JSON document can nest objects inside objects, hold arrays of arrays, and mix types freely. A CSV is a flat grid with one value per cell. The moment your JSON has any nesting, something has to give. A naive converter either throws an error, silently drops nested fields, or stringifies them into cells that look like garbage when opened in Excel. That's the core challenge — and the reason two “JSON to CSV” tools can produce completely different output from the same input.

Flattening Strategies (and When to Use Each)

There are three common ways to flatten nested JSON into CSV columns. Dot notation turns user.address.city into a single column header. It's predictable and readable, and it's the right default for most datasets. Array expansion turns one JSON record with an array of three orders into three CSV rows, duplicating the parent fields. This is ideal for relational analysis but inflates row counts. Stringification keeps arrays or objects as raw JSON inside a single cell — compact, but painful to work with downstream. Pick the strategy that matches the question you're trying to answer with the data.

The One-to-Many Problem

Most real-world JSON is one-to-many: one customer with many orders, one product with many variants, one page with many tags. The cleanest way to represent this in CSV is to either (a) duplicate parent rows for each child (good for pivot tables) or (b) export two separate CSVs linked by a shared ID (good for SQL-style joins). The answer depends on the tool consuming your CSV. Spreadsheets love denormalized, duplicated rows. Databases and BI tools prefer normalized linked tables. If you're unsure, denormalize — most downstream users find it easier to collapse duplicates than to join two files.

Delimiters, Quotes, and Encoding Gotchas

A comma inside a string field will break a lazy parser. RFC 4180 says you wrap any value containing a comma, a newline, or a double quote in double quotes, and escape internal quotes by doubling them. Not every tool follows the spec — which is why you'll sometimes see CSVs that use semicolons, tabs, or pipes as delimiters. If your target is Excel on a German or French locale, a semicolon delimiter may open cleaner than a comma. And always save as UTF-8 with a BOM if non-ASCII characters (accents, Chinese, emoji) need to survive the trip into Excel — without the BOM, Excel often guesses wrong and garbles your data.

Preserving Types: Numbers, Booleans, and Dates

CSV has no type system — every value is text. That becomes a problem when Excel auto-interprets your data: SKUs starting with a zero get truncated, long numeric IDs get converted to scientific notation, and strings that look like dates (MAR1, 2-1) become actual dates. The defensive move is to import your CSV into Excel via the Data tab with column types set manually, rather than double-clicking the file. If you control the CSV, prefix problem IDs with a character like a tab or use a leading apostrophe to force text treatment.

A Practical Workflow in Your Browser

For most teams, the ideal workflow is: paste or drag your JSON into a converter, preview the flattened columns, adjust the delimiter and flattening strategy, then download the CSV. Because sensitive data is often involved — customer records, order histories, analytics exports — a good converter should run entirely in your browser so nothing is uploaded. The JSON to CSV Converter on TinyTool handles all of this client-side: nested objects flatten automatically with dot notation, array fields can be expanded into rows or kept as strings, and the output is RFC 4180-compliant. Pair it with the JSON Formatter if your source data needs cleanup first, or the CSV Viewer to sanity-check the result without opening Excel.

When JSON to CSV Is the Wrong Move

Sometimes the answer is: don't convert. If your data is deeply hierarchical (think GraphQL responses, survey answers with conditional branches, or configuration objects), flattening it into CSV will lose relationships that are hard to reconstruct. In those cases, consider exporting to Excel with multiple sheets, writing to a SQLite database, or keeping the JSON and using a tool like DuckDB to query it directly. CSV is best when the data is essentially rectangular — if yours isn't, respect its shape and pick a format that can hold it. For everything else, a quick, private, in-browser conversion is one paste away.