Skip to content

CSV to Nested JSON Converter

Flat CSV doesn't map naturally to nested JSON structures - until you use dot notation in your headers. Column headers like `user.name`, `user.email`, `address.street`, `address.city` automatically convert to nested objects: `{ user: { name, email }, address: { street, city } }`. Perfect for prepping data for APIs that expect nested payloads.

When to use this

Use when: importing CSV into an API that expects nested objects (most modern REST/GraphQL APIs), prepping test fixtures with realistic nested structures, migrating denormalised CSV exports into normalised JSON for a NoSQL store (MongoDB / Firestore).

Frequently Asked Questions

How do I create arrays in nested JSON?

Use bracket notation in headers: `tags[0]`, `tags[1]`, `tags[2]` produces `{ tags: ['value1', 'value2', 'value3'] }`. Or use comma-separated values in a single column with a special suffix like `tags[]` to split into an array.

What if a key collision happens?

Two columns mapping to the same path (e.g. both `user.email`) - the later column wins. The converter warns you in the preview when collisions occur so you can rename one of the columns.

Powered by CSV to JSON Converter.

Other targeted versions of this tool — each tuned for a specific use case.

Or use the main CSV to JSON Converter if your use case isn't covered above.