CSV to JSON and JSON to CSV
CSV files are what spreadsheets export, and JSON is what websites, apps and APIs expect. Moving data between them by hand is slow and easy to get wrong, especially when a value contains a comma or a quotation mark. This free converter turns CSV into a list of JSON objects and turns JSON back into CSV, entirely inside your browser, so your data is never uploaded.
How to use it
- Paste CSV or JSON into the large box. The first row of a CSV must be the column names.
- For CSV to JSON, decide whether the box about turning numbers into numbers should stay ticked.
- Press CSV to JSON to convert, or JSON to CSV to go the other way.
- Read the status line, which reports how many records or rows were converted.
- Copy the output from the Result box.
Worked example
| Name | Age | City |
|---|---|---|
| Asha | 30 | Pune |
| Smith, J | 25 | Delhi |
The sample CSV has a header row and two data rows. The second name contains a comma, so it is wrapped in quotation marks, and the converter reads it correctly as one value. The result is two JSON objects: Asha with age 30 and city Pune, and "Smith, J" with age 25 and city Delhi. Pressing JSON to CSV on that output gives the same table back, with the quoted name protected again.
How quotes and commas are handled
- A value wrapped in quotation marks may contain commas and even line breaks without splitting into extra columns.
- Two quotation marks in a row inside a quoted value stand for one literal quotation mark. The text x "q" is read correctly from the CSV form.
- When converting to CSV, any value containing a comma, quotation mark or line break is wrapped and escaped for you.
Numbers and leading zeros
With number conversion on, plain numbers such as 30 or 4.5 become real JSON numbers. Values with leading zeros such as 007 stay as text, because turning them into numbers would lose the zeros, which matters for codes, postcodes and identifiers. Switch the option off to keep every value as text.
JSON to CSV rules
- The JSON must be one object or a list of objects. Plain lists of numbers are rejected with a message.
- The columns are the union of all keys found, so objects with different keys still work and missing values are left empty.
- Nested objects are written into the cell as JSON text, because a flat table cannot hold structure.
- Null becomes an empty cell.
Typical uses
Developers use it to create test data, to prepare spreadsheet exports for an API, and to inspect responses in a table. Analysts use it to move survey results into tools that accept JSON. Teachers and students use it to see how the same data looks in both formats, which is a good way to learn what JSON objects and arrays are.
Checking your converted data
Look at the status line first. If you pasted a CSV with twenty data rows, it should report twenty records. A smaller number usually means blank lines were skipped, and a larger one can mean a value with a hidden line break outside quotation marks. Then scroll the Result box and compare the first and last record with your source. Pay attention to numbers, because a column that mixes text and numbers will give some values as numbers and some as strings.
For JSON going the other way, remember that the first object does not decide the columns. Every key found anywhere in the list becomes a column, in the order it first appears, so a key that exists in only one object still gets its own column.
Common mistakes to avoid
- Pasting a CSV without a header row, which makes the first data row become the column names.
- Expecting nested JSON to become several columns. It is stored as text in one cell.
- Using semicolons as separators. This tool expects commas.
- Leaving a quotation mark open, which produces a message that a quoted value is not closed.
- Forgetting that duplicate column names are renamed with a number so no data is lost.
Frequently asked questions
Is my data uploaded anywhere?
No. The conversion runs locally in your browser.
What happens with duplicate headers?
The second one gets an underscore and a number, such as name_2, so both columns survive.
Can it read files?
Paste the contents into the box. Open the file in any text editor and copy it across.
Why did my ID lose its zeros?
It did not. Values with leading zeros are kept as text on purpose.
Does it accept an empty cell?
Yes. Empty cells become empty strings in JSON.
Related tools and guides
This tool is provided for general use. Check converted data before importing it into important systems.
💡 Use this tool offline — save Coswaa as a web app on your phone. Works without internet, zero storage, completely free.
📲 Add to Home Screen →