CSV to JSON converter

Converting CSV to JSON turns each row of a delimited text table into an object, using the header row's column names as the object's keys.

Convert CSV to a JSON array of objects using the header row as keys, with comma, semicolon or tab delimiters and dotted headers built into nested objects.

Browser-sideNo accountCopy, download, or print

Last reviewed

Your inputs are saved as a draft in this browser only. Nothing is uploaded.

Jump to result
Interactive workspace

Inputs

Up to 200,000 characters and 10,000 rows.

Result

More export options

Rows4
Columns6
OutputJSON array
ValuesKept as strings

Every value is kept as a string, exactly as written in the CSV. Numbers and true/false are not converted, so leading zeros and long IDs survive.

Preview: first 4 of 4 rows

idnameemailaddress.cityaddress.countryactive
C-1001Acme Trading Ltdaccounts@acme.exampleLeedsGBtrue
C-1002Example Retail, Inc.ap@example-retail.exampleAustinUStrue
C-1003Muster Handel GmbHbuchhaltung@muster.exampleBerlinDEfalse
C-1004Gulf Supplies LLCfinance@gulf.exampleDubaiAEtrue
[
  {
    "id": "C-1001",
    "name": "Acme Trading Ltd",
    "email": "accounts@acme.example",
    "address": {
      "city": "Leeds",
      "country": "GB"
    },
    "active": "true"
  },
  {
    "id": "C-1002",
    "name": "Example Retail, Inc.",
    "email": "ap@example-retail.example",
    "address": {
      "city": "Austin",
      "country": "US"
    },
    "active": "true"
  },
  {
    "id": "C-1003",
    "name": "Muster Handel GmbH",
    "email": "buchhaltung@muster.example",
    "address": {
      "city": "Berlin",
      "country": "DE"
    },
    "active": "false"
  },
  {
    "id": "C-1004",
    "name": "Gulf Supplies LLC",
    "email": "finance@gulf.example",
    "address": {
      "city": "Dubai",
      "country": "AE"
    },
    "active": "true"
  }
]

Examples

Header row to keys

id,name followed by 1,Acme becomes [{"id":"1","name":"Acme"}]. Values stay as text, exactly as they appear in the file.

Dotted headers to nested objects

With the dotted-header option on, a column named address.city becomes {"address":{"city":"Leeds"}} instead of a key with a dot in it.

Quoted values

"Acme, Inc.",42 is two fields: Acme, Inc. and 42. A doubled quote inside quotes, as in "say ""hi""", becomes say "hi".

Semicolon files from Excel

A file saved by Excel in a language that uses the decimal comma is usually separated by semicolons. If every row comes out as one column, choose Semicolon.

No header row

Turn the header row off and the columns are named column1, column2 and so on.

How to use it

  1. Paste the CSV text.
  2. Choose the delimiter and whether the first row holds the column names.
  3. Choose whether column names with dots should become nested objects.
  4. Check the preview and notes, then copy or download the JSON.

Questions

Are numbers converted to JSON numbers?
No. Every value is kept as a string, exactly as written in the CSV, so leading zeros, long IDs and codes such as 00123 are not changed.
What happens when rows have different numbers of fields?
Missing fields become empty strings, and a note lists the rows that differ from the header so you can check the file.
Can it read quoted fields with commas and line breaks?
Yes. It parses CSV following RFC 4180, so quoted fields can contain the delimiter, line breaks and doubled quotes.
Why did my file come out as one column?
The delimiter probably doesn't match. Files from Excel in many European languages use semicolons, and some exports use tabs. The tool notes when it spots this.
How large a file can I convert?
Up to 200,000 characters and 10,000 rows.
Is my data uploaded?
No. The conversion runs entirely in your browser and nothing is uploaded.