How to Convert CSV to JSON: Complete Guide
Last updated: 2026-04-14
CSV (Comma-Separated Values) is the workhorse of tabular data exchange. JSON (JavaScript Object Notation) is the lingua franca of web APIs. Sooner or later, every developer needs to move data from one to the other. Maybe you exported a database table and need to feed it into a REST endpoint, or you are building seed data for a test suite. Whatever the reason, the conversion itself should take seconds, not minutes.
Step-by-Step: Convert CSV to JSON with Convertee
- Open Convertee and select CSV as the source format and JSON as the target.
- Paste your CSV into the input panel, or drag-and-drop a
.csvfile. - Adjust options if needed — delimiter, header row toggle, JSON indent level, and root structure (array of objects vs. array of arrays).
- Click Convert (or press Cmd+Enter).
- Copy the JSON output or download it as a
.jsonfile.
Your data never leaves the browser. Convertee runs the conversion entirely in JavaScript on your machine — no server round-trip, no data retention.
Understanding the Formats
CSV
CSV is a plain-text format described informally by RFC 4180. Each line is a record; fields are separated by a delimiter (usually a comma). The first line may be a header row that names each column. Quoting rules handle commas and newlines inside field values.
JSON
JSON is defined by ECMA-404 and RFC 8259. It supports strings, numbers, booleans, null, arrays, and objects. For tabular data, the most common shape is an array of objects where each object represents a row and keys match column headers.
Before / After Example
Input CSV:
name,age,city
Alice,30,Seoul
Bob,25,TokyoOutput JSON (array of objects, 2-space indent):
[
{
"name": "Alice",
"age": "30",
"city": "Seoul"
},
{
"name": "Bob",
"age": "25",
"city": "Tokyo"
}
]Common Use Cases
- API seed data. You have a spreadsheet of test users and need JSON fixtures for your API tests or database seeder.
- Configuration files. Some tools accept JSON config where your source of truth lives in a shared Google Sheet exported as CSV.
- Data visualization. Libraries like D3.js, Chart.js, or Recharts accept JSON arrays. Converting a CSV export from your analytics dashboard lets you prototype charts quickly.
- Migrating between systems. Legacy systems often export CSV; modern microservices expect JSON payloads over HTTP.
Options and Configuration
| Option | Default | What It Does |
|---|---|---|
| Delimiter | Comma (,) | The character that separates fields. Switch to tab, semicolon, or pipe if your CSV uses a different separator. |
| Header row | On | When enabled, the first row becomes object keys. When disabled, the output is an array of arrays. |
| JSON indent | 2 spaces | Choose 2 or 4 spaces, tabs, or minified (no whitespace) for the output. |
| Root structure | Array of objects | records produces [{key: value}, ...]. arrays produces [[…], […]]. |
| Trim whitespace | On | Strips leading and trailing spaces from each cell value. |
Frequently Asked Questions
- Does Convertee upload my CSV file to a server?
- No. All parsing and conversion happens in your browser using JavaScript. Your data never leaves your machine.
- What is the maximum file size I can convert?
- The free tier supports files up to 1 MB. This covers most CSV exports you will encounter day-to-day.
- How does Convertee handle CSV files with no header row?
- Toggle the 'Header row' option off. The output will be an array of arrays instead of an array of objects, since there are no column names to use as keys.
- Can I convert CSV with semicolons or tabs instead of commas?
- Yes. Use the Delimiter option to switch between comma, tab, semicolon, pipe, or a custom character.