CSV To JSON
Turn spreadsheet rows into a JSON array, using the header row as keys.
CSV To JSON
Spreadsheets and exports come as CSV, while APIs, scripts and front-end code prefer JSON. Paste your rows and the header line becomes the keys of each JSON object.
How to use CSV To JSON
- Paste your CSV, with a header row, into Enter your CSV Data.
- Tick Pretty Print JSON if you want indented, readable output.
- Click Convert to JSON and copy the result.
When it comes in handy
- Turning spreadsheet exports into fixtures and seed data for apps.
- Feeding CSV data into an API or JavaScript project.
- Checking how a CSV file will look as structured data.
Frequently asked questions
What if a value contains a comma?
Wrap it in double quotes in the CSV, as spreadsheet programs do when they export, so the comma is not treated as a separator.
Are numbers converted to numbers?
Check the output for the types you need. If a field must stay text, such as a postcode with a leading zero, verify it before using it in code.
Related guides
-
JSON vs XML vs CSV: Choosing the Right Data Format for Your Project
JSON, XML and CSV each solve a different problem. Here is how to pick the right one, plus tools to convert and validate between them.
-
How to Fix Invalid JSON: The 8 Most Common Errors
Trailing commas, single quotes, unquoted keys and the other mistakes that break JSON, with before-and-after examples and a quick way to find the problem.
-
Unix Timestamps Explained: Epoch Time for Humans
What a Unix timestamp is, why it counts from 1970, seconds vs milliseconds, time zones, the year 2038 problem, and how to convert timestamps quickly.