HomeFile Converter ToolsCSV to JSON
CSV→JS
File

CSV to JSON Converter

Convert CSV to JSON with delimiter detection, output mode selection (array of objects, array of arrays, or keyed by field), pretty-print toggle, and live preview. Handles quoted fields, escaped commas, and multi-line values.

📋 3 output modes🔧 Delimiter selector✨ Pretty-print👁 Live preview
Converters:
🔒 100% Private — All conversion runs in your browser. No files are uploaded to any server.

📖 How to Use CSV to JSON

  1. 1
    Upload or paste CSV and set options

    Drop a CSV file or paste data. Select your delimiter (auto-detect, comma, tab, semicolon, pipe). Choose whether the first row is a header. Select output mode: Array of Objects (API-friendly), Array of Arrays (compact), or Keyed JSON (indexed by a specific column).

  2. 2
    Preview the JSON output

    The converted JSON appears in the output panel in real time. Toggle Pretty Print for human-readable indented JSON, or compact mode for smaller file size. The output shows the total record count.

  3. 3
    Copy or download

    Click Copy to copy the JSON to your clipboard, or Download .json to save as a file. The downloaded filename matches your input CSV filename with .json extension.

💡 Quick Reference

Mode Example output
Objects [{"name":"Alice"}]
Arrays [["Alice",30]]
Keyed {"alice":{...}}
Pretty-print Indented / readable

Frequently Asked Questions — CSV to JSON

What are the three JSON output modes?

Array of Objects: each row becomes an object using header row as keys. [{name:"Alice",age:30},{name:"Bob",age:25}]. Most common for APIs. Array of Arrays: each row is an array of values. [["Alice","30"],["Bob","25"]]. Compact, no key repetition. Keyed JSON: an object where each record is indexed by a chosen field value. {"alice":{name:"Alice",age:30}}. Useful for lookup tables.

How are quoted fields handled?

RFC 4180 CSV standard allows values to be quoted with double-quotes, enabling commas within values: "Smith, John" parses as a single field "Smith, John". Double-double-quotes escape a literal quote: "He said ""hello""" parses as He said "hello". This tool uses PapaParse which fully implements RFC 4180, correctly handling quoted multi-line values and escaped quotes.

What happens to empty cells in JSON?

Empty CSV cells become empty strings ("") in JSON by default. You can optionally convert empty strings to null values, which is more semantically correct for JSON (representing absence of value). Null-safe option treats empty cells as JSON null rather than "".

Can I convert a CSV with inconsistent columns?

If some rows have fewer columns than the header row, the missing values default to empty string or null. If some rows have more columns than the header, extra columns are ignored (or included as index-based keys). PapaParse handles these edge cases gracefully.

How do I use the JSON output in JavaScript?

If you selected Array of Objects: const data = JSON.parse(jsonString); data.forEach(row => console.log(row.name)). If keyed: const lookup = JSON.parse(jsonString); console.log(lookup["alice"].email). JSON from this tool is immediately usable in JavaScript, Node.js, Python (json.loads()), or any language with JSON parsing.

What is the maximum CSV size?

PapaParse handles CSV files up to the browser memory limit — practically up to 50–100 MB reliably. Very large files (500k+ rows) may take a few seconds to parse. The JSON output of a large CSV can be significantly larger than the CSV input because keys are repeated for every record in Array of Objects mode.