CSV is easy to open in a spreadsheet. JSON is easy to use in APIs and code. Moving between them sounds simple, but small details can break the data.

The CSV and JSON Converter helps convert CSV to JSON and JSON back to CSV in the browser.

The simple idea

CSV is a table:

name,email
Ana,ana@example.com
Budi,budi@example.com

JSON can represent the same data as an array of objects:

[
  { "name": "Ana", "email": "ana@example.com" },
  { "name": "Budi", "email": "budi@example.com" }
]

The first CSV row usually becomes the JSON field names.

Step 1: check the header row

A clean CSV should have clear headers:

name,email,role

Avoid empty or duplicate headers if possible. JSON object keys should be meaningful.

Bad:

name,,name

Better:

name,email,role

Step 2: check the delimiter

Most CSV files use commas, but not all. Some use semicolons or tabs.

Comma-separated:

name,email
Ana,ana@example.com

Semicolon-separated:

name;email
Ana;ana@example.com

If the delimiter is wrong, the converter may treat the whole row as one field.

Step 3: watch quoted values

CSV values can contain commas if they are quoted:

name,note
Ana,"likes coffee, tea, and bread"

A good converter keeps that note as one value, not three columns.

If your data contains commas, quotes, or line breaks inside cells, inspect the output carefully.

Step 4: convert to JSON

Open CSV and JSON Converter, paste the CSV, choose the right delimiter, and convert.

Check the output shape:

[
  {
    "name": "Ana",
    "note": "likes coffee, tea, and bread"
  }
]

If the keys look wrong, go back to the header and delimiter.

Step 5: remember that CSV has weak types

CSV is text. It does not strongly know the difference between:

123

and:

"123"

Depending on the converter and settings, numbers may stay as strings or become JSON numbers.

This matters for IDs. A value like this should often stay a string:

00123

If it becomes a number, the leading zeros may be lost.

Step 6: convert JSON back to CSV carefully

JSON arrays of flat objects convert cleanly:

[
  { "name": "Ana", "email": "ana@example.com" }
]

Nested JSON is harder:

[
  { "name": "Ana", "address": { "city": "Jakarta" } }
]

A table does not naturally contain nested objects. The converter may flatten them or turn them into JSON text inside a cell.

Check the result before using it in a spreadsheet or import job.

My CSV/JSON checklist

Before trusting a conversion, I check:

  1. Does the CSV have a header row?
  2. Is the delimiter correct?
  3. Are quoted commas handled correctly?
  4. Are row counts correct before and after?
  5. Did IDs keep leading zeros?
  6. Did empty fields become the expected value?
  7. Is the JSON an array of objects?
  8. If converting back to CSV, is nested data handled acceptably?

Conversion is not only changing format. It is preserving meaning.

Comments

Comments are welcome — please read the comment policy first. Powered by giscus and GitHub Discussions.