Free · Fast · Privacy-first

JSON to CSV Without Flattening

Sometimes you want JSON-to-CSV conversion but you do not want the converter to recursively expand every nested object into dotted columns.

Native JSON tool

JSON to CSV

Runs in your browser
CSV output
Run the tool to see a task-specific result.

Top-level keys become columns only

🔒

Nested values stay as JSON

Narrow output, easy to read

Lossless round-trip preserved

Cost
Free tier
Sign-up
Not required
Processing
Tool-specific
Privacy
Clearly disclosed
IframeResponsiveAttribution included

Add this JSON to CSV to your website

Drop the JSON to CSV into a blog post, product docs, intranet, or school portal with one iframe. Processing, privacy, and usage limits are the same as on the full tool page.

  • One copy-ready line of HTML
  • Responsive — adapts to any container width
  • No API credentials are placed in the snippet

Embed code

<iframe
  src="https://www.fixtools.io/json/json-to-csv?embed=1"
  width="100%"
  height="780"
  frameborder="0"
  style="border:0;border-radius:16px;max-width:900px;"
  title="JSON to CSV by FixTools"
  loading="lazy"
  allow="clipboard-write"
></iframe>

Attribution-friendly: a small "Powered by FixTools" link appears in the embed footer.

When keeping JSON inside cells is the right choice

Flattening is the default in most JSON-to-CSV tools because it produces analyst-friendly columns. But flattening is not always what you want. If your nested objects are opaque, such as a metadata blob with hundreds of keys you do not care about, flattening produces a sea of irrelevant columns. If your CSV is destined for re-import into a JSON-aware tool, flattening throws away structural information that downstream code needs. If your audience treats the CSV as a transport format rather than an analysis target, narrow output with JSON-encoded cells is easier to scan than wide output with hundreds of dotted columns.

The no-flatten mode in FixTools keeps top-level keys as the column set and writes nested values, both objects and arrays, as compact JSON strings in their cells. The cell content is a single line of valid JSON that any tool with a JSON parser can re-hydrate into the original structure. Excel and Google Sheets display the JSON string as opaque text, which is the right behaviour because there is no useful spreadsheet operation on raw JSON anyway. Pandas can re-parse the cell with json.loads when the analyst needs to drill into the nested data.

The CSV escaping rules apply correctly to JSON-encoded cells. Because JSON strings contain literal double quotes, every cell with JSON content gets enclosed in double quotes and every internal double quote gets doubled per RFC 4180. The result is a slightly bulkier cell but a fully spec-compliant CSV that opens cleanly in any tool. The encoded JSON inside the cell preserves Unicode characters in their natural form because the surrounding UTF-8 CSV can carry them directly, which means there is no need for the JSON escape sequences like \u00e9 to represent é.

The trade-off is that spreadsheet-side analysis of the nested data is impossible without re-parsing. If the analyst needs to filter on a field inside a nested object, they have to either re-parse the JSON in their tool of choice or go back and run the conversion again with flattening enabled. Many teams hand both versions to the analyst: the flat version for filter and pivot, the JSON-preserved version for archival and re-import. FixTools makes generating both quick because the source JSON is already pasted; you just toggle the flatten setting and re-download.

How to use this tool

💡

Convert JSON to CSV using only top-level keys as columns. Nested objects and arrays are written as JSON strings inside their cells.

How It Works

Step-by-step guide to json to csv without flattening:

  1. 1

    Paste your JSON

    Paste your JSON into the editor or upload a .json file. The parser shows top-level keys and any nested structures.

  2. 2

    Switch flatten depth to 0

    In the options panel, set flatten depth to 0 or pick the no-flatten preset. This tells the converter to use only top-level keys as columns and to serialise nested values as JSON strings.

  3. 3

    Confirm in preview

    The preview table shows narrow columns with JSON-encoded text in cells that contain nested objects or arrays. Width should be much smaller than a fully flattened version.

  4. 4

    Download the CSV

    Download the CSV. Open it in Excel or your tool of choice. The nested fields appear as JSON text that downstream code can re-parse when needed.

Real-world examples

Common situations where this approach makes a real difference:

Archive CSV for re-import to JSON

A data engineer needs a CSV archive of API responses that can be re-imported into a JSON-aware tool later. No-flatten mode preserves the original structure as JSON-encoded cells, so a future re-import pulls back the same shape.

Audit log export

A security engineer exports audit logs as JSON and needs a CSV for record-keeping. The nested event details are not for spreadsheet analysis but must be preserved exactly. No-flatten mode keeps every field intact.

Lightweight CSV transport

A mobile app dev generates CSVs as an export format for end users. Wide flattened columns would overwhelm the UI. No-flatten produces a narrow CSV that downloads quickly and re-imports cleanly into the same app.

Backup of API responses

A QA engineer keeps daily snapshots of API responses for regression testing. No-flatten mode preserves the original shape so diff tools compare structure faithfully across snapshots.

Pro tips

Get better results with these expert suggestions:

1

Pair no-flatten with a flattened sibling

Generate two CSVs from the same JSON: one flattened for analysts to pivot on, one not flattened for archive and re-import. Both versions live alongside each other in storage and serve different audiences without compromise.

2

Use compact JSON in cells

FixTools writes JSON-encoded cells in compact form (no extra whitespace) to keep the CSV small. If you need pretty-printed JSON inside cells for readability, switch the cell-format option in the panel.

3

Re-parse cells with json.loads in pandas

When loading the no-flatten CSV in pandas, apply df["col"].apply(json.loads) to a JSON-encoded column to re-hydrate it into Python dicts or lists. This is the standard pattern for downstream analysis of preserved-structure CSVs.

4

Watch row size for very large nested objects

A CSV row containing several deeply nested JSON objects can become large. Most spreadsheet tools have per-cell character limits in the tens of thousands. If a cell exceeds the limit, flatten that particular path instead.

FAQ

Frequently asked questions

Three main reasons: when nested objects are opaque blobs you do not need to analyse, when you plan to re-import the CSV into a JSON-aware tool and want to preserve structure, and when you want a narrow CSV that scans easily rather than a wide one with hundreds of columns. No-flatten serves all three.
Yes. RFC 4180 requires fields containing commas, newlines, or double quotes to be enclosed in double quotes with internal quotes doubled. FixTools applies these rules to JSON-encoded cells, producing fully spec-compliant CSV that opens correctly in every modern spreadsheet tool.
Excel displays them as plain text, which is the right behaviour. There is no meaningful spreadsheet operation on raw JSON. If an analyst wants to drill in, they can copy the cell into a JSON viewer or re-run the conversion with flattening enabled.
Yes, exactly. Every value from the source JSON is written verbatim into the CSV, with structure preserved as JSON strings inside cells. A downstream JSON parser can rehydrate the cells back into the original nested shape without information loss.
They are the same thing. Depth 0 means do not flatten any level, which is identical to the no-flatten preset. The label in the UI just makes the intent clearer for users who do not think in terms of depth.
Not directly through depth controls, which apply uniformly. For per-field control, preprocess the JSON with jq to flatten only the paths you want, then run the result through FixTools with no-flatten to leave the rest nested.
Usually yes. Flattening expands every nested key into its own column, and empty cells for records missing a path still take a delimiter per record. No-flatten keeps everything in one cell per nested path, which is more compact for sparse nested data.

Related guides

More use-case guides for the same tool:

Ready to get started?

Open JSON to CSV to review its free limits and processing method.

Open JSON to CSV →

Free tier · No account needed · Transparent limits

Source-backed reference

JSON standards quick reference

Concise, standards-backed facts for developers working with JSON debugging and validation. Each rule links to a primary specification so it can be independently verified before you rely on it in code, documentation, or an incident report.

JSON standard
RFC 8259 defines JSON as a text format for serializing structured data. JSON values may be objects, arrays, strings, numbers, true, false, or null.
Verify in RFC 8259
Strings and object keys
JSON strings and object member names use double quotation marks. Single-quoted strings are not valid JSON syntax.
Verify in RFC 8259 §7
Trailing commas
The JSON grammar does not allow a comma after the final member of an object or the final element of an array.
Verify in RFC 8259 §4–5
Interoperability
ECMA-404 describes the JSON syntax independently of any programming language, which is why standard parsers can exchange the same JSON text across runtimes.
Verify in ECMA-404

Common invalid → valid JSON examples

Trailing comma

{"a":1,}{"a":1}

Single-quoted key

{'a':1}{"a":1}

Unsupported literal

{"score":NaN}{"score":null}

Built for verification, not just extraction

Direct answers are paired with primary sources and concrete examples. That makes this page useful to developers and also gives search and answer systems a clear, verifiable statement to reference instead of an unsupported summary.