CSV to JSON

Convert CSV files to JSON with auto-delimiter detection, type coercion, and three output formats: array of objects, array of arrays, or keyed by first column.

csv json convert parse data
Free Client-Side Private
🔒 This tool runs entirely in your browser — your files are never uploaded to any server.

The CSV to JSON Converter is a free, browser-based tool that transforms comma-separated values files into JSON format. Paste any CSV data, configure your delimiter and output format, and get clean, properly typed JSON in seconds. All processing runs entirely in your browser — nothing is uploaded.

Features

Feature Detail
Auto-detect delimiter Automatically identifies comma, semicolon, tab, or pipe from the input
Manual delimiter selection Override auto-detection with a specific delimiter
Output formats Array of objects, array of arrays, or keyed by first column
Header row toggle Treat the first row as column names or generate col0, col1, col2 keys
Auto-convert types Converts numeric strings to numbers and "true"/"false"/"null" to native JSON types
Indentation options 2 spaces, 4 spaces, tab, or minified output
Quoted field support Correctly handles RFC 4180 quoted fields, including embedded newlines and escaped quotes
Copy to clipboard Copy the full JSON output with one click
Download JSON Save the result as output.json directly from the browser
File load Load a .csv, .tsv, or .txt file without leaving the page
Stats bar Shows data row count, column count, JSON size, and detected delimiter

How to Use

  1. Paste CSV data into the CSV input area, or click Load to open a file.
  2. Choose a delimiter, or leave it on Auto-detect.
  3. Select an output format and indentation level.
  4. Toggle First row is header and Auto-convert numbers & booleans as needed.
  5. Click Convert to JSON.
  6. Click Copy to copy to the clipboard, or Download to save output.json.

Output Formats

Array of Objects (default)

Each CSV row becomes a JSON object, with keys taken from the header row:

name,age
Alice,30
Bob,25

becomes:

[
  { "name": "Alice", "age": 30 },
  { "name": "Bob",   "age": 25 }
]

This is the most common format, compatible with most REST APIs and JavaScript applications.

Array of Arrays

Each row (including the optional header row) becomes a JSON array of values:

[
  ["name", "age"],
  ["Alice", 30],
  ["Bob", 25]
]

Useful when column names are separate metadata, or when working with matrix-style data.

Keyed by First Column

The first column's value becomes the key of the top-level JSON object. Useful when the first column contains unique identifiers:

{
  "Alice": { "name": "Alice", "age": 30 },
  "Bob":   { "name": "Bob",   "age": 25 }
}

Auto-detect Delimiter

When set to Auto-detect, the tool scans the first 2000 characters of the input, counts how often each candidate delimiter (comma, semicolon, tab, pipe) appears outside quoted fields, and selects the one that appears most frequently. The detected delimiter is shown in the stats bar after conversion.

If your file uses an unusual delimiter, choose it manually from the dropdown.

Type Coercion

When Auto-convert numbers & booleans is enabled:

CSV value JSON output
42 42 (number)
3.14 3.14 (number)
true true (boolean)
false false (boolean)
null null
`` (empty) null
Alice "Alice" (string, unchanged)

Disable this option if you want all values output as strings, which avoids ambiguity for fields that look numeric but should stay as strings (e.g. phone numbers, postal codes, ID strings with leading zeros).

Handling Quoted Fields

The parser is RFC 4180 compliant. It correctly handles:

  • Quoted fields containing the delimiter: "New York, NY" is parsed as a single field.
  • Quoted fields containing newlines: multi-line cell values are preserved.
  • Escaped double quotes: "" inside a quoted field is decoded as a single ".

Use Cases

API Development

Many data sources expose CSV exports. Convert them to JSON to feed mock data into REST APIs, test fixtures, or frontend prototypes.

Database Seeding

Convert CSV exports from spreadsheets into JSON arrays for use as seed files in Node.js, Python, or PHP database seeding scripts.

Data Integration

Transform exported reports from analytics tools, CRMs, or ERP systems into JSON for import into other platforms.

Configuration Files

Some tools accept JSON configuration arrays. If your configuration is maintained in a spreadsheet, export it as CSV and convert it here.

Frontend Development

Hardcode lookup tables, option lists, or reference data as JSON arrays in your application by converting from a CSV maintained in a spreadsheet.

Data Validation

Converting CSV to JSON makes it easy to inspect data types and structure — a useful step when troubleshooting import errors or data pipeline issues.

Frequently Asked Questions

What happens if rows have different numbers of columns?

Each row is mapped to the header keys in order. If a row has fewer values than headers, the missing fields are set to an empty string (or null if auto-conversion is on). If a row has more values than headers, the extra values are ignored.

Can I convert TSV (tab-separated values) files?

Yes. Either select Tab (\t) from the delimiter dropdown, or use Auto-detect — the tool will identify the tab as the delimiter if it appears more frequently than other candidates.

What does "Keyed by first column" do if the first column has duplicate values?

Later rows will overwrite earlier rows with the same key. If your first column contains duplicate values, use the Array of objects format instead to preserve all rows.

Should I leave auto-convert on or off?

Turn it on when you want a clean JSON structure with proper types. Turn it off when you need all values as strings — for example, if your data contains postal codes like 01234 that would lose their leading zero when converted to the number 1234.

Is there a row or file size limit?

There is no server-side limit because all processing runs locally in your browser. Performance depends on your device. Files with hundreds of thousands of rows may take a few seconds on older hardware.

Can the tool handle CSV files with quoted multi-line cell values?

Yes. The parser tracks quoted regions and correctly handles newlines inside quoted fields, so multi-line cell values are preserved in the JSON output.

Report an issue