CSV to JSON Converter
Convert CSV to JSON, or JSON back to CSV, entirely in your browser — no upload required.
How to use the CSV to JSON Converter
- Choose the direction: CSV → JSON or JSON → CSV.
- Paste your data. For CSV, leave "First row is headers" ticked if the first line holds column names.
- Press Convert, then copy the result or press "Use as input" to convert it back the other way.
About the CSV to JSON Converter
CSV (comma-separated values) is the most common plain-text format for tabular data — spreadsheets, database exports, and reports are all commonly saved as CSV. JSON is the format most APIs and JavaScript code expect instead, so converting between the two is a routine step when moving data from a spreadsheet into an app, or turning an API response into something you can open in Excel or Google Sheets.
This tool converts in both directions, entirely in your browser: paste CSV and get back an array of JSON objects (using the first row as field names), or paste a JSON array and get back a CSV file's contents. It correctly handles quoted fields, commas and line breaks inside values, and escaped quotes — the parts of CSV that break naive splitting on commas.
Worked example
Example: converting the CSV `name,age\nAna,29\nLee,34` produces `[{"name":"Ana","age":"29"},{"name":"Lee","age":"34"}]` — each row becomes an object keyed by the header row.
How the conversion handles your data
In CSV-to-JSON mode, fields are separated by commas and rows by line breaks, following the standard CSV quoting rules: a field wrapped in double quotes can contain commas and line breaks, and a doubled quote ("") inside it stands for one quote character. With the header option on, the first row supplies the keys and each later row becomes an object; a blank header cell gets a name like column3. With it off, each row becomes a plain array.
Every value comes out as a string, so '29' stays "29" rather than becoming the number 29. That's deliberate: the converter can't know whether '007' is a number or a code that needs its leading zeros. Convert types in your own code once you know what each column means.
In JSON-to-CSV mode, the header row is built from every key found in any object, in the order they first appear, so objects with missing keys simply get empty cells.
Files from Excel and other spreadsheets
In many European locales, Excel saves 'CSV' files with semicolons instead of commas, because the comma is the decimal separator there. Those files will come through as a single column. Change the separator when exporting, or replace the semicolons first. Tab-separated files have the same issue.
Opening converted CSV in a spreadsheet
Spreadsheet apps try to be helpful when they open a CSV, and that can change your data: leading zeros are dropped from codes like ZIP codes and phone numbers, long numbers turn into scientific notation, and values that look like dates are converted. Use the app's import feature and set those columns to Text, rather than double-clicking the file, when the exact values matter.
Frequently asked questions
- What happens to commas or line breaks inside a CSV value?
- As long as the value is wrapped in double quotes in the source CSV (the standard way to escape it), this tool parses it correctly as a single field rather than splitting it into extra columns — this is the most common source of broken CSV parsing in simpler tools.
- Does JSON to CSV work with nested objects or arrays?
- Nested objects and arrays inside a field are converted to their JSON string form and placed in that cell, since CSV has no native way to represent nested structure. For fully flat data (the common case), every value converts directly.
- What if my CSV rows have different numbers of columns?
- Missing values are filled in as empty strings so every JSON object has the same set of keys from the header row. Extra columns beyond the header row are dropped, since there's no header name to assign them to.
- Is my data uploaded anywhere?
- No. Both conversions run entirely in your browser using JavaScript — nothing you paste is sent to a server, so it's safe to convert data exported from internal spreadsheets or private databases.