CSV to JSON

Convert CSV or TSV into a JSON array of objects. The first row supplies the keys.

Drop a file or click to browse

or paste data below

Need the reverse conversion? JSON to CSV

How CSV to JSON works

How rows become objects

The first line is read as the header row, and each header becomes a key. Every line after it becomes one object in a JSON array, in the same order as the file. Spaces around header names are trimmed, blank lines are skipped, and a row where every cell is empty is dropped.

If two columns share a name, the second is renamed with a suffix (email, email_1) so no value is silently overwritten. A byte-order mark at the start of the file, common in exports from Excel on Windows, is removed so it does not end up inside the first key.

Tab-separated input is detected from the header line, so you can paste TSV copied from a spreadsheet directly without converting it to CSV first.

For side-by-side format examples and advice on choosing a format, read CSV vs TSV vs JSON.

Every value stays a string

The converter does not guess types. 30 becomes "30", an empty cell becomes "", and true stays the text "true". That is deliberate: type guessing is the most common way CSV-to-JSON tools corrupt data. ZIP codes, product SKUs, and phone numbers with leading zeros keep them, and long numeric IDs do not lose precision by being forced into a JavaScript number.

If your application needs real numbers or booleans, convert the specific fields you care about in code after parsing, where you can decide how to treat blanks and invalid values.

Quoting and malformed rows

Fields follow standard CSV quoting: a value wrapped in double quotes can contain commas and line breaks, and a doubled quote ("") inside a quoted field becomes one literal quote character.

When a row has more fields than the header, the extra values are left out of the JSON and a warning names the row. When a row has fewer fields, the missing keys are filled with empty strings. Both warnings usually mean an unquoted comma or a stray line break in the source export, so check the rows they name before using the output.

Example

The quoted comma stays inside the name, the leading zeros in sku and zip survive, and the empty price becomes an empty string.

CSV input
sku,name,price,zip
00142,"Desk lamp, brass",24.50,02134
00977,Notebook,,10001
JSON output
[
  {
    "sku": "00142",
    "name": "Desk lamp, brass",
    "price": "24.50",
    "zip": "02134"
  },
  {
    "sku": "00977",
    "name": "Notebook",
    "price": "",
    "zip": "10001"
  }
]

How to use CSV to JSON

  1. 1

    Paste CSV or TSV into the input, drop a file, or load the sample.

  2. 2

    Check that the first row holds your column names; they become the JSON keys.

  3. 3

    Read any row warnings shown under the output before relying on the result.

  4. 4

    Copy the JSON or download it as converted.json.

When to use it

Seed data and fixtures

Turn a spreadsheet of products, users, or settings into a JSON file a test suite or seed script can load.

Mock API responses

Build realistic front-end mock data from an export instead of typing objects by hand.

CSV to JSON questions

Why are my numbers wrapped in quotes?

All values are kept as strings so leading zeros, long IDs, and blanks are not changed. Convert the fields you need to numbers in your own code after loading the JSON.

My CSV has no header row. What happens?

The first data row is used as keys. Add a header line with the column names you want before converting.

Can I get nested JSON from dotted column names like user.name?

Not here; keys are copied as written. Use the Nest mode in the Flatten JSON tool to turn dotted column names back into nested objects.

Does it handle semicolon-separated files?

No. Comma and tab are detected. For semicolon-separated exports, replace the delimiter first or re-export the file with commas.

Questions about privacy, file size, or accounts are answered on the FAQ page.

Other tools in the same category, starting with the reverse conversion

Search all tools