What is CSV?
CSV (Comma-Separated Values) is a plain-text format for tabular data. Each line represents one row, and values within a row are separated by a delimiter character — most commonly a comma. CSV is the default export format for spreadsheet applications like Microsoft Excel, Google Sheets, and LibreOffice Calc, as well as many databases and reporting tools.
A typical CSV file looks like this:
Name,Age,City
Alice,30,Berlin
Bob,25,Hamburg
Carol,35,Munich
What is JSON?
JSON (JavaScript Object Notation) is the de facto standard format for data interchange on the web. It is human-readable, easy to parse in every programming language, and natively supported by browsers and REST APIs. The CSV example above would convert to JSON as:
[
{"Name": "Alice", "Age": "30", "City": "Berlin"},
{"Name": "Bob", "Age": "25", "City": "Hamburg"},
{"Name": "Carol", "Age": "35", "City": "Munich"}
]
When Do You Need CSV to JSON Conversion?
- Feeding spreadsheet data into a REST API — APIs consume JSON, not CSV
- Loading test fixtures — JSON objects map cleanly to TypeScript interfaces
- Importing data into MongoDB, Firestore, or similar NoSQL databases
- Processing data in Node.js or Python scripts that expect JSON input
- Prototyping without a database — embed JSON directly in your frontend
Choosing the Right Output Format
Array of Objects
Each CSV row becomes a named object. The header row provides the property names:
[{"Name": "Alice", "Age": "30"}]
Use this format when:
- Passing data to a REST API or GraphQL mutation
- Mapping rows to typed objects in TypeScript (
interface User { Name: string; Age: string }) - Working with ORMs or database insert helpers
Array of Arrays
The header becomes the first element and rows are plain arrays:
[["Name", "Age"], ["Alice", "30"], ["Bob", "25"]]
Use this format when:
- Processing data with index-based logic (
row[0],row[1]) - Sending compact payloads where property names waste bandwidth
- Feeding data into matrix or table-rendering libraries
Delimiter Guide
| Delimiter | Symbol | When to use |
|---|---|---|
| Comma | , | Default for English-locale exports |
| Semicolon | ; | European Excel exports (decimal separator is , there) |
| Tab | \t | TSV files, copy-paste from spreadsheet cells |
| Pipe | | | Log files, SQL dumps, custom exports |
If your parsed output looks wrong, the most likely cause is the wrong delimiter. Try switching from comma to semicolon or tab.
Handling Quoted Fields
The parser follows RFC 4180 CSV rules:
- Fields surrounded by double quotes may contain the delimiter character without being split
- Double quotes inside a quoted field are escaped by doubling them:
""→" - Quoted fields may span multiple lines
Example:
Name,Description
"Smith, John","He said ""Hello"" and left"
Parses correctly to:
[{"Name": "Smith, John", "Description": "He said \"Hello\" and left"}]
All Values Are Strings
CSV has no type system — every cell is a string. This tool preserves that: "30" stays "30", not 30. If you need numeric values, apply type coercion after conversion in your code:
const users = csvData.map(row => ({
...row,
age: Number(row.Age),
}));
Privacy
All processing runs in your browser. Your CSV data never reaches any server, is never logged, and is never stored. You can use this tool entirely offline once the page has loaded.