CSV to JSON and JSON to CSV Converter

Paste or drop a file, pick a direction, and get clean JSON or CSV. The delimiter is detected for you.

Paste or drop your data

Choose a file or drop it here

.csv, .tsv, .json or .txt, up to 25 MB. Your file is read in your browser and not uploaded.

How to use the CSV to JSON converter

  1. Choose CSV to JSON or JSON to CSV.
  2. Paste into the input box or drop a file on the drop zone (Enter opens the file picker). Sample data is loaded to start.
  3. For CSV, leave Delimiter on Auto-detect or pick one. Then set First row as headers, Convert numbers and booleans, Trim spaces around values, the JSON output shape and the indent.
  4. For JSON, pick the Output delimiter, Flatten nested objects and Protect against spreadsheet formulas.
  5. The result updates as you type. Use Copy output or Download.

How the conversion works

The CSV reader follows the quoting rules of RFC 4180: quoted fields can hold delimiters, line breaks and doubled quotes. JSON follows RFC 8259. Type detection is strict: a cell becomes a number only when it is a plain decimal such as 32 or 0.5, with no leading zero or plus sign and at most 15 digits. The words true and false become booleans and null becomes null. Everything else, including 02134, +15551234567 and 1e3, stays text.

Repeated headers get a suffix (name, name_2), blank headers become column3, and extra cells in a long row go under keys such as column6. For JSON to CSV the columns are every key in the order first seen, nested objects become dotted names like address.city, and a wrapper such as {"data": [...]} is unwrapped. Cells that start with =, +, - or @ get a leading apostrophe so a spreadsheet will not run them, as OWASP advises. Related: JSON formatter, TSV to CSV, XML to JSON.

Worked example

The page opens on a five-row sample CSV with the columns name, age, city, email and salary. The delimiter is detected as a comma and the status line reads Converted 5 rows to JSON. The first object is {"name": "Alice Johnson", "age": 32, "city": "New York", "email": "[email protected]", "salary": 85000}. Age and salary are numbers because they are plain. Charlie "Chuck" Brown keeps his inner quotes, and "San Francisco, CA" stays one value because it was quoted.

Limits and edge cases

Frequently asked questions

How do I convert CSV to JSON?

Paste the CSV into the input box or drop a .csv file on it. Leave Delimiter on Auto-detect and keep First row as headers ticked, and the JSON array of objects appears on the right. Use Copy output or Download to take it with you.

Why did my ZIP codes or IDs change when I converted to JSON?

They should not. The converter only turns plain numbers such as 32 or 0.5 into JSON numbers. Values with a leading zero (02134), a plus sign (+15551234567), more than 15 digits or an exponent (1e3) stay as text. Untick Convert numbers and booleans to keep every value as text.

How do I convert a semicolon or tab separated file?

Leave Delimiter on Auto-detect and the tool counts commas, semicolons, tabs and pipes in the first lines and picks the best fit. You can also choose the delimiter yourself. Many European exports use semicolons because commas mark decimals.

How does JSON to CSV handle nested objects and arrays?

With Flatten nested objects ticked, a value such as {"address": {"city": "Austin"}} becomes a column named address.city. Arrays stay in one cell as JSON text. If the JSON is wrapped, like {"data": [...]}, the array inside is used.

What is the largest file I can convert?

The limit is 25 MB per file. Everything runs in your browser, so very large files depend on your device's memory. For bigger data sets use a command-line tool such as jq or csvkit.

Sources: RFC 4180, CSV format, RFC 8259, JSON, OWASP, CSV injection.