📊

CSV to JSON

Convert CSV data to JSON array with automatic header detection.

Input
JSON Output

📖 What is CSV to JSON?

CSV to JSON converts comma-separated values into a JSON array of objects, using the first row as property names. Each subsequent row becomes a JSON object with key-value pairs matching the headers.

Use it to prepare spreadsheet data for API requests, convert database exports into JSON for web applications, or transform CSV files into a format your code can easily parse. Everything runs in your browser — your data is never uploaded.

💡 Example

Input
name,age,city Alice,30,NYC Bob,25,London
Output
[{"name":"Alice","age":30,"city":"NYC"}, {"name":"Bob","age":25,"city":"London"}]

🛠️ Common Use Cases

  • Preparing spreadsheet data for REST API POST requests
  • Converting database CSV exports into JSON for web applications
  • Importing Excel data into MongoDB, Firebase or other JSON-based stores
  • Transforming CSV log files into structured JSON for analysis
  • Building JSON seed data for testing from spreadsheet templates

📝 How CSV Parsing Works

The parser follows the RFC 4180 standard: commas separate fields, double quotes wrap values that contain commas or newlines, and two consecutive double quotes inside a quoted field represent a literal quote. The first row is always treated as headers.

Numeric values are auto-detected and converted to JSON numbers. Values that look like true/false become JSON booleans. Everything else stays as a string.

⚠️ Common Mistakes

  • No header row — if your CSV has no headers, the first data row gets used as keys, producing meaningless property names
  • Tab-separated data — TSV files use tabs, not commas. Replace tabs with commas first, or check if the tool auto-detects the delimiter.
  • Trailing commas — extra commas at the end of rows create empty fields. Clean the CSV before converting.
  • Mixed encodings — CSV files from Excel may use Windows-1252 encoding. Save as UTF-8 CSV for correct Unicode handling.

❓ Frequently Asked Questions

Does it auto-detect data types?
Yes — numeric values become JSON numbers, true/false become booleans, and everything else stays as a string. If you need all values as strings, you can post-process the JSON output.
Can I convert TSV (tab-separated) data?
This tool expects comma-separated input. For TSV data, replace all tabs with commas before pasting, or use a text editor find-and-replace.
What happens with empty cells?
Empty cells become empty strings in the JSON output. If you need them as null values, you can find-and-replace "" with null in the output.
Is my data private?
Yes — all processing runs entirely in your browser using JavaScript. Your data is never sent to any server.
Is this tool free?
Completely free — no login, no usage limits, and it works offline once the page is loaded.
Yes — completely free, no login required, no usage limits.
Is my data private?
Yes — all processing runs in your browser. Your data is never sent to any server.
Does it work offline?
Yes — once the page is loaded, the tool works without an internet connection.
🔒
Your data stays private. All processing happens entirely in your browser using JavaScript. Nothing is ever sent to our servers. You can even use this tool offline after the page loads.