Get started with json2csv CDN

MIT licensed

JSON2CSV converts JSON data into CSV format for easy import into spreadsheet applications.

Tags:
  • json
  • to
  • csv
  • export
  • convert
  • parse

Stable version

Copied!

How to start using json2csv CDN


<!DOCTYPE html>
<html>
<head>
  <title>Get started with json2csv CDN - cdnhub.io</title>
  <script src="https://cdn.jsdelivr.net/npm/[email protected]/papaparse.min.js"></script>
  <script src="https://cdn.cdnhub.io/json2csv/5.0.7/json2csv.umd.min.js"></script>
</head>
<body>
  <script>
    const jsonData = [
      { "Name": "John Doe", "Age": 30, "City": "New York" },
      { "Name": "Jane Doe", "Age": 28, "City": "Chicago" },
      { "Name": "Bob Smith", "Age": 45, "City": "Los Angeles" }
    ];

    const csvContent = json2csv(jsonData, { fieldSeparator: ',', quoteStrings: '"' });

    const link = document.createElement('a');
    link.href = 'data:text/csv;charset=utf-8,' + encodeURIComponent(csvContent);
    link.download = 'output.csv';
    document.body.appendChild(link);
    link.click();
  </script>
</body>
</html>
Copied!
Copied!

All versions