BYTETOOLS

JSON to CSV Tips: Best Practices and Mistakes to Avoid

The cleanest JSON-to-CSV conversions come from three habits: feed the tool a flat array of objects, choose the delimiter that matches your spreadsheet's locale, and let the converter handle escaping instead of pre-quoting fields yourself. The mechanics are simple, but a few decisions upstream determine whether your CSV opens as a tidy table or a mangled mess. Here is what experienced users get right.

Best practices before you convert

  • Flatten nested data if you want real columns. Nested objects and arrays are serialised as JSON strings inside a single cell. That keeps data intact, but if you need address.city as its own column, flatten the structure in your JSON first.
  • Make keys consistent across objects. The header row is the union of all keys, so a typo like email in one object and e-mail in another produces two columns. Normalise keys before converting.
  • Pick the delimiter for your audience. Comma is standard, but European locales that use a comma decimal separator often need semicolons, and some pipelines expect tabs.
  • Convert an array, not a wrapper. If your records sit under data: [...], extract the array so each object becomes a row.

Common mistakes and how to avoid them

MistakeResultFix
Expecting nested fields to split into columnsA JSON string in one cellFlatten the JSON first
Inconsistent key namesDuplicate near-identical columnsNormalise keys across objects
Comma delimiter in a comma-decimal localeNumbers split across columns in ExcelSwitch to semicolon
Manually quoting fields yourselfDouble-escaped, broken cellsLet the tool handle escaping
Passing a bare object as if it were rowsA one-row tableWrap multiple records in an array

Getting escaping and alignment right

The converter already does the hard part: any field containing a comma, quote or newline is wrapped in double quotes and internal quotes are doubled, matching the CSV standard Excel and Sheets expect. So do not pre-quote your values β€” that just produces double-escaped output. Alignment is handled too: when an object is missing a key, the tool writes an empty cell rather than shifting the remaining values left, so every row stays under the correct header. The one thing you own is consistency of shape β€” the more uniform your objects, the cleaner the table.

A privacy tip worth building into your workflow

Because the conversion runs entirely in your browser with nothing uploaded, it is the right default for database dumps, exported user data and API payloads that should never touch a third-party server. Keep those conversions here rather than pasting sensitive records into a hosted converter. It also works offline as a PWA, so a quick JSON-to-CSV on a restricted machine is never a problem.

Try the JSON to CSV Converter β€” free and 100% in your browser.

FAQ

How do I get nested fields into their own columns?

Flatten the nested structure in your JSON before converting β€” for example, promote address.city to a top-level city key. The converter serialises anything still nested into a single JSON-string cell, which is intentional to keep the table stable.

Why did Excel split my numbers across columns?

That is a delimiter-locale mismatch: your spreadsheet treats the comma as a decimal separator and also as the field delimiter. Re-export with the semicolon delimiter, and the numbers will land in one column each.

Should I quote fields myself before converting?

No. The tool applies standard CSV quoting and escaping automatically. Pre-quoting leads to double-escaped, broken cells β€” paste raw values and let the converter handle special characters.

My rows look misaligned β€” what went wrong?

Misalignment usually means inconsistent keys across objects created extra columns, or a nested value was expected to split. Normalise your keys and flatten nested fields, then reconvert; the tool itself keeps missing keys as empty cells rather than shifting data.

Related free tools

Built by ByteVancer

ByteTools is a free product of ByteVancer, a software and web development studio building web apps, SaaS and custom software. If converting and cleaning data is a recurring chore, explore how ByteVancer can automate the whole pipeline for your team.