↑↓ to move ↵ to open Esc to close Browse all tools

CSV to JSON

Paste or drop CSV and get clean JSON. The delimiter is detected, quoted fields are read correctly, numbers and true or false values get their types, and your data stays in your browser.

Paste CSV, TSV or cells copied from Excel or Google Sheets, or drop a .csv file here.
Delimiter
Output
JSON result -

Paste CSV to convert it.

Preview

The JSON appears here.

Your CSV is converted in your browser. Nothing is uploaded.

Convert CSV to JSON without uploading anything

A CSV file is a plain grid of text. JSON gives every value a name and a type, so code can use it directly. This CSV to JSON converter reads a CSV or TSV file, or cells you copy straight out of Excel or Google Sheets, and turns every row into a JSON object with the headers as keys. It detects the delimiter, reads quoted fields correctly, gives numbers and true or false values their proper types and shows you what it found, row by row, before you download the result.

All of it happens in a background thread of your browser. Nothing is uploaded, so exports with customer data stay on your device, and big files of 50 MB and more convert without freezing the page. To check or reformat the JSON afterwards, open it in the JSON formatter. Going the other way, the JSON to CSV converter turns JSON back into a spreadsheet.

How the CSV is read

The converter follows RFC 4180, the document that describes the common CSV format, and is forgiving where real files differ from it:

  • Quoted fields. A field in double quotes may hold commas, line breaks and quotes, with each quote inside written twice. "Smith, Ann" is one value and "say ""hi""" reads as say "hi".
  • Line breaks. RFC 4180 ends records with CRLF. Files that end lines with LF only, or with CR only, are read the same way. Blank lines are skipped.
  • Delimiters. Auto tries comma, semicolon, tab and pipe on the first rows and picks the one that splits them into the same number of fields. Pick one yourself if the guess is wrong.
  • Headers. The first row holds the names of the fields when First row holds headers is on. Empty headers get names like column_3, and a repeated header gets _2, so no value overwrites another. Switch the option off for files without headers and the keys become column_1, column_2 and so on.
  • Encoding. Files are read as UTF-8, and a byte order mark at the start is ignored. A file that is not valid UTF-8 is read as Windows-1252 instead, and a notice says so, so check accented letters in the preview.

Spaces around values are kept, because RFC 4180 counts them as part of the field. Turn on Trim spaces around values for files typed by hand, like name, age. Rows with fewer or more fields than the header are kept, and a notice tells you on which lines they start.

Numbers, true and false, null and leading zeros

CSV has no types: every value is text. With Detect numbers, true, false and null on, the converter decides per column:

Values in a columnIn the JSON
42, -7.5, 1.5e3Numbers, written exactly as in the file
true, FALSE, Truetrue and false
null or NULLnull, in any column
02134, 90210Text, because of the leading zero
1,5 or $20 or 12345678901234567890Text

A column only turns into numbers when every non-empty value in it is a valid JSON number as defined in RFC 8259, which allows no leading zeros, no thousands separators and no plus sign. That keeps ZIP codes, phone numbers and article numbers intact. RFC 8259 also notes that programs reading numbers as 64-bit floating point values only agree exactly on whole numbers up to 253 minus 1, so values with more than 15 significant digits stay text as well, and you never lose the last digits of an ID. Numbers with a decimal comma, like 1,5, stay text too.

Empty cells become empty text by default. Choose null if your code checks for missing values, or Leave the key out to keep the objects small.

Choose the JSON shape you need

Array of objects is the usual choice, one object per row. Array of arrays keeps the grid as it is, which is compact and suits charts and tables. Keyed by column builds one object whose keys are the values of a column you choose, like an ID or a country code. JSON keys should be unique, as RFC 8259 says, so if a key appears twice the last row wins and a notice tells you. Nest columns with dots turns headers like address.city into nested objects and tags.0, tags.1 into arrays, the same naming the JSON to CSV converter uses when it flattens.

Pretty output is indented for reading, Minified drops all optional spaces and line breaks for the smallest file.

How to use the CSV to JSON converter

  1. 1Paste CSV or spreadsheet cells, drop a .csv file on the box or open one. The example shows a typical file.
  2. 2Check the detected delimiter and whether the first row holds headers, and decide whether values should get types.
  3. 3Pick the output shape and format, and read any notice about short rows or repeated headers.
  4. 4Check the preview, then download the .json file or copy the JSON.

Frequently asked questions

Is my CSV uploaded anywhere?

No. The file is read and converted by your browser, in a background thread on your own device. Nothing is sent to a server, so customer lists, exports and reports stay private. Copy link only shares your settings, never the data.

Can I paste cells straight from Excel or Google Sheets?

Yes. Select the cells including the header row, copy them and paste them into the box. Auto detects whether the values are separated by tabs, commas, semicolons or pipes, and the first row becomes the headers. Check the Table preview to see each value in its column.

Why are my ZIP codes or IDs still strings?

On purpose. A column only becomes numbers when every value in it is a plain JSON number. A value with a leading zero, like the ZIP code 02134, would lose its zero as a number, so the whole column stays text, and 90210 in the same column stays "90210" too. The same goes for numbers with more than 15 significant digits, which a 64-bit floating point number does not always hold exactly.

How are quoted fields with commas and line breaks handled?

As RFC 4180 describes. A field in double quotes can contain the delimiter, line breaks and double quotes, with every quote inside written twice. So "Smith, Ann" is one value, and "say ""hi""" becomes say "hi". Line numbers in warnings count the real lines of your file, including those inside quoted fields.

What happens with rows that have too few or too many fields?

Nothing is dropped. Missing values at the end of a short row count as empty, and extra values in a long row get their own keys, named column_5 and so on. A notice lists the lines with a different number of fields, so you can check them in your file.

What do the output formats mean?

Array of objects gives one object per row, with the headers as keys, which is what most APIs and JavaScript code expect. Array of arrays keeps the table shape, with the headers as the first array. Keyed by column turns the rows into one object, keyed by the column you pick, such as an ID, which makes lookups by that value easy.

Can I get nested JSON from flat columns?

Yes. Turn on Nest columns with dots and headers like address.city and address.zip become {"address": {"city": ..., "zip": ...}}. Headers like tags.0 and tags.1 become an array. This is the reverse of how the JSON to CSV converter flattens nested objects, so data survives the round trip.