CSV to JSON and JSON to CSV Converter

Convert spreadsheet-style CSV data to JSON, or turn a JSON array into CSV, in one click. The converter detects commas, semicolons, tabs and pipes, handles quoted fields, can convert numbers and booleans, and flattens nested objects. Your data stays in your browser.

Related Tools

JSON Formatter & Validator Remove Duplicate Lines Base64 Encoder & Decoder Text Diff Checker Markdown to HTML Converter All Utilities

CSV and JSON: why convert between them?

CSV is the simplest way to move table data between spreadsheets, databases and exports. JSON is the standard format for web APIs and applications. Developers constantly need to move data from one to the other: loading a spreadsheet into an app, sending an export to an API, or opening API results in Excel.

This tool does the conversion in both directions. It follows the common CSV rules from RFC 4180, so fields wrapped in double quotes can contain commas, line breaks and quote marks, and it produces clean, indented JSON that you can copy or download.

How to convert CSV to JSON

  1. Choose CSV to JSON and paste your data. The delimiter is detected automatically, or you can pick one.
  2. Keep First row is a header ticked if the first line holds column names.
  3. Keep Convert numbers and true/false ticked to get real numbers and booleans, or untick it to keep everything as text.
  4. Press Convert and copy or download the JSON.
  5. To go the other way, choose JSON to CSV and paste an array of objects.

Delimiters and regional settings

Despite the name, CSV files do not always use commas. In many European countries, where the comma is the decimal separator, spreadsheet programs export with semicolons. Tab-separated and pipe-separated files are also common. Auto-detect looks at the first line and picks the separator that appears most often outside quotes, and you can override it if the guess is wrong.

JSON to CSV: nested data

CSV is flat, but JSON can be nested. When you convert JSON to CSV with Flatten nested objects ticked, a field such as address with a city inside becomes a column called address.city. Arrays inside records are written as JSON text in a single cell. The columns are the union of all keys found, so records with different fields still line up.

Tips for clean conversions

  • Make sure every row has the same number of columns.
  • Remove blank header cells, or the tool will name them column1, column2 and so on.
  • Values with leading zeros, such as ZIP codes and phone numbers, stay as text so the zeros are not lost.
  • Duplicate column names are renamed with a number, so no data is overwritten.
  • Open the result in a JSON formatter to validate it.

Example: an API-ready conversion

Suppose a spreadsheet export has the columns id, name and active, with a row 7,Anna,true. With header and type conversion on, the result is an object with id as the number 7, name as the text Anna and active as the boolean true, which is the shape most APIs expect. If you keep type conversion off, every value stays a string. Always check a few rows of the result, especially numbers that should stay text, such as phone numbers and product codes.

How a CSV row becomes JSON

CSV JSON
name,age Anna,31 [{ name: Anna, age: 31 }]
city;price Berlin;4,50 Semicolon detected, price kept as text
id,note 1,"Hello, World" The quoted comma stays inside the value

Frequently Asked Questions

How do I convert CSV to JSON?

Paste the CSV, keep the header option on and press Convert. The JSON appears below.

How do I convert JSON to CSV?

Choose JSON to CSV, paste an array of objects and press Convert.

Why are my numbers strings?

Make sure Convert numbers and true/false is ticked. Values with leading zeros, such as 007, are kept as text on purpose so the zeros are not lost.

Which delimiters are supported?

Comma, semicolon, tab and pipe, with automatic detection.

Can it handle quoted fields and line breaks?

Yes. Quoted fields can contain commas, double quotes and line breaks.

What if my JSON is nested?

Nested objects are flattened to dotted column names, and arrays are written as JSON text.

Is my data uploaded?

No. The conversion happens in your browser.