About This Tool
Convert CSV spreadsheets into JSON arrays and turn JSON arrays back into CSV, with a choice of delimiter and header handling. Everything runs in your browser.
Moving data between spreadsheets and code
CSV is what spreadsheets, databases and reporting tools export. JSON is what web APIs, configuration files and JavaScript code expect. This converter goes both ways in a single screen: paste CSV on the left and turn it into JSON, or paste a JSON array on the right and turn it into CSV. It is handy for developers seeding a database, analysts handing data to an engineering team, or anyone who needs to get an exported sheet into an app. The parsing happens in your browser, so the data you paste is not uploaded anywhere.
How to use the converter
- Open the Options panel if your data is not comma-separated. You can pick comma, semicolon, tab or pipe as the delimiter.
- Leave First row is header ticked if the first line holds column names. Untick it if every line is data.
- Choose whether you want Pretty print JSON (indented, easy to read) or compact single-line output.
- Paste your CSV into the CSV box and click CSV → JSON, or paste a JSON array into the JSON box and click JSON → CSV.
- Use Copy to grab the result, or the .csv / .json buttons to download it as a file.
What the output looks like
With the header option on, each data row becomes an object whose keys come from the header line. So name,age followed by Jane,25 becomes [{"name": "Jane", "age": "25"}]. With the header option off, every row becomes a plain array of values, giving you an array of arrays. Note that all values come out as strings: the tool does not guess whether 25 is a number or true is a boolean, and it trims surrounding spaces from each value. If your code needs real numbers, convert those fields after loading the JSON.
Going the other way, the JSON must be an array. An array of objects produces a header row built from every key found across all objects, in the order the keys first appear, so objects with missing fields simply get empty cells. An array of arrays produces rows with no header.
How CSV quoting works
CSV looks simple until a value contains the delimiter itself. The common convention, described in RFC 4180, is to wrap such values in double quotes: "Smith, John" is one field, not two. A double quote inside a quoted field is written twice, so "He said ""hi""" means He said "hi". Quoted fields may also contain line breaks, which is how a multi-line address can live in one cell.
This tool follows those rules when reading CSV, and when writing CSV it quotes any value containing the delimiter, a double quote or a newline, doubling inner quotes as needed.
Tips and common mistakes
- European exports often use semicolons. If every row lands in a single field, switch the delimiter to semicolon.
- Tab-separated data copied straight from a spreadsheet uses tabs. Pick Tab in the options.
- Flatten nested JSON first. A nested object or array inside a record cannot fit in one CSV cell and will appear as
[object Object]or a comma-joined list. - Duplicate column names collapse into one key in JSON, with the later column winning. Rename them before converting.
- Check the JSON with the JSON validator if the converter reports a parse error.
Frequently asked questions
Why are my numbers wrapped in quotes in the JSON?
CSV has no data types, so the converter keeps every value as text rather than guessing. That avoids surprises such as ZIP codes losing their leading zeros.
Can I convert the JSON further into YAML?
Yes. Copy the output into the JSON to YAML converter.
Does the header checkbox affect JSON to CSV?
No. When converting from an array of objects, a header row is always written from the object keys.
Is there a size limit?
There is no fixed limit, but very large files are processed in your browser's memory, so files of many megabytes may make the page slow.