CSV to JSON converter (and JSON to CSV)
Turn a spreadsheet into clean JSON for an app, API or script, or turn a JSON export into a table you can open in Excel. The tool picks the direction from the file you choose.
Choose CSV, Excel or JSON files
or drop .csv, .xlsx or .json files here
Up to 20 files at a time. Your files stay on this device.
Or paste CSV or JSON text
Options
Preview and download
This converter is taking a while to load. Check your connection, then reload the page.
Your files stay on this device: the conversion runs in your browser and nothing is uploaded. Learn how your files are handled
How to convert CSV to JSON
- Choose a CSV or Excel file, or paste CSV text. The first row gives the field names (the JSON keys). For a workbook with several sheets, pick the sheet.
- Pick the layout: a list of records (an array of objects, the most common), one record per line (JSON Lines, used by many data tools) or rows as lists (an array of arrays).
- Decide how values are written. By default, plain numbers (including ZIP codes without a leading zero, such as
90210) become JSON numbers, and true and false become JSON true/false values. Values with leading zeros (007,02134), codes written like1E5, and numbers with more than 15 digits stay as text, because turning them into numbers would change them. For columns of codes, choose “Keep everything as text”. - Download the .json (or .jsonl) file. The preview shows the first lines.
How to convert JSON to CSV
- Choose a .json or .jsonl file, or paste JSON. The tool finds the records for you: a list at the top level of the file, or the largest list of records inside it, such as
data.itemsin an API response. - Choose how lists are written: joined in one cell, kept as JSON text, or one column per item.
- Download a CSV or an Excel workbook.
An example
| name | age | address.city | member |
|---|---|---|---|
| Ann | 34 | Paris | true |
becomes
[
{
"name": "Ann",
"age": 34,
"address": { "city": "Paris" },
"member": true
}
]
Going the other way, the nested address object turns back into an address.city column, so you can convert ordinary data to JSON and back and get the same table. Only names made of plain words joined by dots are nested. Headings such as S.No. or Amt. (USD) stay as they are.
In CSV files made from JSON, text that a spreadsheet would run as a formula (text starting with = or @, for example) gets an apostrophe added at the start. The Excel (.xlsx) download keeps every value exactly.
Details that are handled
- Commas, quotes and line breaks inside CSV values, and files separated by semicolons or tabs.
- Long whole numbers (16 or more digits) in JSON, such as order or account IDs, are kept exactly instead of being rounded.
- Records with different keys: every key becomes a column, and missing values are left blank.
- Empty cells can be written as
"", asnull, or left out.
Frequently asked questions
Which JSON layout should I choose?
A list of records (an array of objects) suits most apps and APIs. Choose JSON Lines for data tools that read one record per line, such as BigQuery and many log and data-loading tools. Choose rows as lists (an array of arrays) for the smallest file, with the header as the first row.
Will numbers like 00123 or long IDs be changed?
No. Values with leading zeros, and numbers longer than 15 digits, are written as text, so they stay exactly as in your file. Choose “Keep everything as text” to write every value as text.
How is nested JSON turned into columns?
Nested objects become columns named with dots (address.city). Lists can be joined into one cell, kept as JSON text, or spread over numbered columns (tags.0, tags.1).
Can I convert an API response?
Yes. Save or paste the response. If the records sit inside another object (for example {"data": {"items": […]}}), the tool finds the largest list of records and tells you which one it used.
What is the difference between CSV and JSON?
CSV is a flat table: one row per record, the same columns for every row, and a compact file that any spreadsheet opens. JSON stores each record as named fields that can hold lists and nested objects, which suits apps, APIs and settings files. Neither is better in general. Use CSV for spreadsheets and bulk imports, and JSON when a program expects it or the data is nested.
How do I store JSON data in a CSV file?
Give each nested field its own column. Choose the JSON file here, and nested objects become columns named with dots (address.city). Lists can be joined in one cell, kept as JSON text in one cell, or spread over numbered columns. Converting such a CSV back to JSON here turns the dotted names into nested objects again.
How do I convert a CSV file to JSON in Excel?
Excel has no option to save a sheet as JSON. Its Power Query feature can read JSON, but not write it. Choose the .xlsx or CSV file here instead and pick the sheet: the first row gives the field names, and you download a .json file.
Is my data uploaded?
No. The conversion runs in your browser, and the new file is created on your device.