ตัวแปลง CSV ⇄ JSON

แปลงระหว่าง CSV และ JSON

CSV Input
1
JSON Output
1
Code Examples

CSV → JSON (using PapaParse)

const csvData = "name,age,city\nJohn Doe,28,New York\nJane Smith,32,Chicago";

const json = Papa.parse(csvData, {
  header: true,
  skipEmptyLines: true,
  dynamicTyping: true
}).data;

console.log(JSON.stringify(json, null, 2));

JSON → CSV (using PapaParse)

const data = [
  { name: "John Doe", age: 28, city: "New York" },
  { name: "Jane Smith", age: 32, city: "Chicago" }
];

const csv = Papa.unparse(data);
console.log(csv);
About CSV ⇄ JSON Converter

What is CSV ⇄ JSON Converter?

A CSV ⇄ JSON Converter is a tool that transforms data between CSV (Comma-Separated Values) and JSON (JavaScript Object Notation) formats. CSV is commonly used for tabular data in spreadsheets, while JSON is the standard format for APIs, web applications, and structured data.

Common Use Cases

  • Data Import/Export: Convert spreadsheet data to JSON for web applications
  • API Development: Transform CSV data into JSON for API responses
  • Database Migration: Convert CSV exports to JSON for NoSQL databases like MongoDB
  • Data Cleaning: Transform CSV to JSON for easier manipulation and validation
  • Analytics: Convert Google Sheets/Excel CSV to JSON for data analysis scripts
  • Backend Integration: Transform JSON API responses to CSV for reporting

How to Use

  1. Choose your conversion mode (CSV → JSON or JSON → CSV)
  2. Input your data by typing, pasting, or uploading a file
  3. Configure options like delimiter, headers, and formatting
  4. Click "Convert" or enable "Auto Convert" for live conversion
  5. Copy or download the converted output

Features

  • Bidirectional conversion (CSV ↔ JSON)
  • Multiple delimiter support (comma, semicolon, pipe, tab)
  • Header row detection and toggling
  • Auto-detect data types (numbers, booleans)
  • Pretty print JSON output
  • Flatten nested JSON objects for CSV
  • File upload support (.csv and .json)
  • Live conversion mode
  • Error detection and helpful messages