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.cityas 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
emailin one object ande-mailin 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
| Mistake | Result | Fix |
|---|---|---|
| Expecting nested fields to split into columns | A JSON string in one cell | Flatten the JSON first |
| Inconsistent key names | Duplicate near-identical columns | Normalise keys across objects |
| Comma delimiter in a comma-decimal locale | Numbers split across columns in Excel | Switch to semicolon |
| Manually quoting fields yourself | Double-escaped, broken cells | Let the tool handle escaping |
| Passing a bare object as if it were rows | A one-row table | Wrap 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
- CSV Cleaner & Deduplicator β dedupe and tidy the CSV afterwards.
- CSV Viewer & Table β verify columns look right.
- CSV to JSON Converter β round-trip back to JSON.
- JSON Formatter β inspect your JSON before converting.
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.
Recommended reading
JSON to CSV Use Cases: When to Turn JSON Into a Table
Real scenarios for converting JSON to CSV: exporting API data for analysts, prepping reports, importing into databases, and sharing data with non-developers.
How to Convert JSON to CSV Online in Your Browser
Step-by-step guide to turning a JSON array of objects into clean, Excel-ready CSV with automatic headers and proper quoting, entirely in your browser.
CSV to JSON: Pro Tips and Common Mistakes
Avoid the mistakes that produce broken JSON from CSV β delimiter mismatches, header confusion, and quoting pitfalls, with expert best practices.
XOR Cipher Use Cases: CTFs, Learning, and Puzzles
Real use cases for the XOR cipher, from CTF challenges and teaching bitwise logic to lightweight obfuscation, with concrete worked examples.