Convert CSV rows to JSON objects instantly.
The CSV to JSON Converter transforms comma-separated value data into JSON format. CSV (Comma-Separated Values) is the most common data export format from spreadsheets, databases, and analytics tools. JSON is the standard format for APIs, NoSQL databases, and modern web applications. The converter uses the first row as the key names (headers) and each subsequent row as a JSON object. The output is an array of objects, ready for import into MongoDB, use in a JavaScript application, or storage in a JSON field.
Values containing commas must be enclosed in double quotes in CSV: name,description becomes 'Apple','A fruit, red or green'. Most spreadsheet exports handle this automatically.
Yes, if the CSV is UTF-8 encoded. Files exported from Excel may be in Windows-1252 encoding — if you see garbled characters, save the CSV as UTF-8 in Excel first (File → Save As → CSV UTF-8).
Save the JSON array to a file (data.json), then use: mongoimport --db mydb --collection items --file data.json --jsonArray. The --jsonArray flag is required when the file contains an array of documents.