Free CSV ↔ JSON converter
Turn a CSV into JSON, or JSON back into a CSV, in both directions. It runs in your browser, nothing is uploaded.
How to use it
- Paste CSV on the left and click CSV → JSON, or paste JSON on the right and click JSON → CSV.
- Set the options: pretty print, detect numbers and booleans, or flatten nested objects into columns.
- Copy the result or download it as a file. Load example fills in sample data.
Converting between CSV and JSON without surprises
CSV is what spreadsheets and exports give you. JSON is what web apps, APIs and scripts want. Converting between them looks trivial until a value contains a comma, a line break or a quote, which is where most quick scripts and regex tricks go wrong.
CSV to JSON
The first row becomes the keys and every following row becomes one object, so a three-column file with 100 rows gives an array of 100 objects. Duplicate or empty column names are made unique (name, name_2, column_3) so no data is overwritten. If your file has no header row, untick the header option and you get an array of arrays instead.
By default every value is a string, exactly as written. Turn on type detection to get real numbers (24.9), booleans (true) and null for empty cells. It is deliberately cautious: IDs with leading zeros and numbers too large to represent exactly remain strings.
JSON to CSV
Paste an array of objects and each key becomes a column, in the order keys first appear. Objects that miss a key simply get an empty cell. Nested objects can be flattened with dot notation, which suits most API responses, and the output delimiter can be a comma, semicolon or tab for the Excel version you use.
Checking the result
- Open the CSV in your spreadsheet and confirm the column count matches.
- For JSON, look at one record with a tricky value, such as a quoted comma.
- If Excel mangles accents, import the file as UTF-8 rather than double-clicking it.
For one-off jobs a converter like this is the quickest route. If the same conversion has to happen every day on new files, or the data comes from several sources and needs cleaning on the way, it is worth automating once.
Questions people ask
Does it handle commas and line breaks inside a value?
Yes. Values wrapped in double quotes can contain commas, line breaks and escaped quotes (written as two double quotes). The parser follows the standard CSV rules, so "Smith, John" stays one value.
What JSON shapes can it turn into CSV?
An array of objects is the normal case. It also accepts an array of arrays, an array of plain values, a single object, and an object wrapping one array, such as {"data": [...]}. Columns are the union of all keys.
What happens to nested objects and arrays?
With flattening on, nested objects become columns named with dots, like supplier.name. Arrays are written into the cell as JSON text, because there is no single right way to spread them over columns.
Why did 007 stay a string?
With type detection on, a value that starts with a zero (007, 0123) is kept as text because converting it would lose the zeros. The same goes for integers too long to store exactly as a JavaScript number, such as long IDs.
Need this inside a bigger workflow? We write Python scripts that pull data from your files or APIs, convert it, and save it where you need it.
See Python automation