How to convert CSV to JSON
CSV JSON Converter moves data between rows in CSV or TSV files and JSON records. It reads each data row as an object, or turns JSON records into CSV rows. The controls cover headers, inferred values, nested keys, arrays, and selected fields.
How to use the CSV JSON Converter
- Drop JSON, CSV, or TSV files here, or choose
browse files. The file extension selects JSON to CSV or CSV to JSON. - For JSON input, inspect
Recordswhen several array paths are available. For CSV or TSV input, chooseDelimiterand decide ifFirst row is a header. - Set the options for nested objects, arrays, types, output shape, and exported fields.
- Read the preview and warnings. Each valid file has a download control, and
Download converted fileshandles all valid files.
JSON to CSV options for nested records
Turn on Flatten nested objects to turn a path such as address.city into a CSV column. Key separator sets the path style to dots, underscores, or slashes. With flattening off, nested object values reach the CSV row as their JavaScript string form.
Array handling changes how array values become rows. Join values in one cell writes the items in one cell, separated by semicolon and space. Expand into columns writes indexed fields such as tags.0. Expand into rows writes one row per array position and repeats non-array values.
Delimiter accepts Comma (,), Semicolon (;), Tab, Pipe (|), or Custom.... A custom delimiter can contain one character. Include header row adds or removes the header, and Quote all fields quotes every field. Use Fields to export, Select all, and Select none to choose the columns.
CSV to JSON output shape and type inference
Turn off First row is a header when the first row is data. The converter then names columns col1, col2, and so on. With Infer numbers, booleans & null on, recognized numbers, true or false, empty fields, and the word null become JSON values. Turn it off to keep parsed fields as strings.
name,age
Alice,34
[
{"name": "Alice", "age": 34}
]
Enable Un-flatten column names and choose the matching Un-flatten separator to rebuild address.city as a nested object. Choose JSON array of objects for a list, or choose Object keyed by a column and then Key column to store each row under a field value. If a key repeats, the later row replaces the earlier property.
Preview limits and conversion warnings
The CSV preview shows the first 200 rows. The JSON preview shows the first 50 records when the result is an array. JSON to CSV output is capped at 20,000 rows and 200 columns per file, with a warning when the result is truncated. CSV parsing reports unterminated quoted fields and rows whose field count differs from the header.
Invalid JSON produces an error with a line and column when the parser can identify them. A CSV file with no parsed rows is marked as an error. Review warnings before downloading, because errored files are excluded from the valid downloads.
Input patterns that fit CSV JSON Converter
- A developer has JSON records, flattens nested keys, and sends selected columns to a spreadsheet.
- An analyst receives CSV with numeric and boolean text, enables type inference, and passes the JSON array to another script.
- A data editor receives a dotted column such as
address.city, turns onUn-flatten column names, and restores nested JSON.
When another converter fits better
Use Spreadsheet Convert Tools to choose among spreadsheet conversion pages. To turn CSV or TSV into an Excel workbook, use CSV to Excel Converter. For XML output with mapped elements or attributes, use CSV to XML Converter. If each input line is a separate JSON object, JSONL CSV Converter matches the JSON Lines format.
Frequently asked questions
Can I convert TSV to JSON?
Yes. Drop the TSV file into the drop zone and choose Tab in Delimiter so the parser splits each field correctly.
How do I convert JSON to CSV with nested objects?
Enable Flatten nested objects, then choose the path style in Key separator. A nested key such as address.city becomes a CSV column with that name.
Can CSV columns become nested JSON again?
Yes. Enable Un-flatten column names and choose the separator used in the column names, such as dot for address.city.
Does this CSV JSON converter upload files?
The page reads selected files in the browser with FileReader. The page code contains no request that sends their contents to a server.