Skip to content

CSV to JSON Converter

Turn CSV rows into clean JSON in one step, with typed values, custom delimiters and pretty or minified output.

Processed locally in your browser

Options
0 chars · 0 lines
The result will appear here.

What is CSV to JSON Converter?

JSON is the format most APIs and JavaScript code expect, while data often arrives as CSV exports. This converter reads the CSV with a proper parser (quotes, embedded line breaks, BOM, CRLF) and produces either an array of objects, using the first row as keys, or an array of arrays.

With value detection enabled, numbers, true/false and null become real JSON types, while values with leading zeros such as "007" or numbers longer than 15 digits stay strings so identifiers are never corrupted. Duplicate or empty headers are renamed, and keys such as __proto__ are handled safely.

How does it work?

  1. Paste your CSV or open a .csv file; the delimiter is detected automatically unless you choose one.
  2. Keep "First row is a header" for an array of objects, or untick it to get an array of arrays.
  3. Decide whether numbers, booleans and null should be detected, and whether empty cells become null.
  4. Pick pretty (2 or 4 spaces, tabs) or minified output, then copy or download data.json. Use Swap to convert JSON back to CSV.

Common use cases

  • Feeding a spreadsheet export into a REST API, a mock server or a front-end prototype.
  • Creating fixtures and seed data for tests from a shared spreadsheet.
  • Converting configuration tables or translation sheets into JSON files.
  • Preparing data for a chart library that expects an array of objects.

Examples

Try this input in the tool above:

Input
id,name,active,score,city
1,Alice,true,12.5,Paris
2,Bob,false,8,"Lyon, France"
3,Chloé,true,,Nice
Output
[
  {
    "id": 1,
    "name": "Alice",
    "active": true,
    "score": 12.5,
    "city": "Paris"
  },
  {
    "id": 2,
    "name": "Bob",
    "active": false,
    "score": 8,
    "city": "Lyon, France"
  },
  {
    "id": 3,
    "name": "Chloé",
    "active": true,
    "score": "",
    "city": "Nice"
  }
]

Privacy

CSV to JSON Converter runs entirely in your browser. The text or files you provide are processed on your device and are not uploaded, logged or stored on our servers.

Limitations

Conversion happens in memory in your browser, so extremely large files (hundreds of MB) may be slow. Dates are not converted: they stay as text.

Frequently asked questions

Why are some numbers kept as strings?

Values with leading zeros (zip codes, phone numbers) and numbers over 15 digits cannot be represented safely as JSON numbers, so they stay text to avoid losing information.

What happens with duplicate or empty column names?

Empty names become column_N and duplicates get a suffix such as name_2, so every object key is unique and no data is overwritten.

Can I get an array of arrays instead of objects?

Yes. Untick "First row is a header" and every row, including the first one, is output as an array of values.

More tools in JSON & Data →