Product CSV to JSON
Convert product data from Excel/CSV format to JSON for import into e-commerce platforms.
Switch tool:
Examples:
💡 Paste CSV data and it converts to JSON automatically. First row should contain column headers.
Code Examples
Here's how to achieve this in different programming languages:
1// Convert CSV to JSON array2function csvToJson(csv) {3 const lines = csv.trim().split('\n');4 const headers = lines[0].split(',');5 return lines.slice(1).map(line => {6 const values = line.split(',');7 return headers.reduce((obj, h, i) => ({ ...obj, [h]: values[i] }), {});8 });9}1011const csv = `sku,name,price,stock12PROD-001,Widget A,19.99,10013PROD-002,Widget B,29.99,50`;14const json = csvToJson(csv);15console.log(JSON.stringify(json, null, 2));
More CSV Examples
User CSV to JSON
Convert a CSV file with user data to JSON array format.
Spreadsheet to JSON
Convert spreadsheet data exported as CSV to JSON format.
Analytics CSV to JSON
Convert analytics and metrics CSV data to JSON for APIs.
Inventory CSV to JSON
Convert inventory spreadsheet CSV to JSON for inventory management APIs.