Paste a CSV table and get clean JSON output instantly. Handles headers, quotes, custom delimiters, and whitespace. Download the result as a .json file.
CSV (Comma-Separated Values) is a plain text format for tabular data. Each row is a line, and values are separated by a delimiter (usually comma, but can be semicolon, tab, or pipe). The first row typically contains column headers. Values containing the delimiter, newlines, or double quotes must be wrapped in double quotes; double quotes inside values are escaped by doubling them (""). Example: name,age,city then Alice,30,New York on the next line. Despite the name, CSV is more of a loose standard (RFC 4180 exists but compliance varies). This tool handles the most common CSV patterns including quoted fields and whitespace trimming.
Array of objects (most common): each row becomes a JSON object with header names as keys: [{"name":"Alice","age":"30"}]. This is the preferred format for most APIs, databases, and JavaScript processing because each record is self-describing. Array of arrays: each row becomes a JSON array of values, with the first array being the headers: [["name","age"],["Alice","30"]]. This is more compact and used in applications where column-index access is preferred (e.g., spreadsheet-style processing). For most use cases — importing into MongoDB, sending to a REST API, or processing in JavaScript — array of objects is the better choice.
Python: import csv, json; then with open('data.csv') as f: reader = csv.DictReader(f); data = list(reader); print(json.dumps(data, indent=2)). This uses DictReader to automatically map headers to object keys. Node.js: many libraries exist — the simplest is papaparse (npm install papaparse): const Papa = require('papaparse'); const result = Papa.parse(csvString, {header: true}); console.log(JSON.stringify(result.data, null, 2)). For a one-off in bash: python3 -c "import csv, json, sys; print(json.dumps(list(csv.DictReader(open(sys.argv[1]))))) " data.csv. For production, always use a proper CSV parser rather than splitting on commas — quoted fields with embedded commas will break a naive split.
This tool supports four common delimiters: Comma (,) — the standard CSV delimiter used by Excel, Google Sheets, and most data exports. Tab (\t) — common in TSV (Tab-Separated Values) exports from databases and spreadsheet applications; avoids ambiguity when data contains commas. Semicolon (;) — the default in Excel when the system locale uses commas as decimal separators (common in Europe). Pipe (|) — used in legacy systems and log files where commas and semicolons may appear in data. Select the delimiter that matches your source file. If your CSV looks like it has one long column per row, you're likely using the wrong delimiter.
CSV (Comma-Separated Values) stores tabular data as plain text. Each row is a line; values are separated by a delimiter. Converting to JSON makes the data consumable by APIs, databases, and JavaScript applications. The first row is typically column headers, used as keys in the resulting JSON objects.
Array of objects uses header names as keys: [{"name":"Alice","age":"30"}]. Best for APIs, MongoDB imports, and JavaScript forEach loops. Array of arrays is more compact: [["Alice","30"]]. Better for columnar processing or spreadsheet-style data access.
If your CSV output shows one long column per row, you're using the wrong delimiter. European Excel exports use semicolons (;) instead of commas. Database exports often use tabs (TSV). Select the delimiter that matches your source file. The trim-whitespace option removes leading/trailing spaces from each field, which is helpful for data exported from databases with fixed-width columns.