# Convert CSV to JSON

> Convert CSV to JSON online. Free CSV to JSON converter with a worked example and a live editor — turns spreadsheet rows into an array of objects.

Exported a spreadsheet and need it as JSON for an API or a seed file? This converter reads the CSV header row as keys and turns every following row into a JSON object, giving you a clean array of records.

## Example: CSV → JSON

Input:
```
id,name,role
1,Ada,engineer
2,Linus,maintainer
```

Output:
```
[
  {
    "id": "1",
    "name": "Ada",
    "role": "engineer"
  },
  {
    "id": "2",
    "name": "Linus",
    "role": "maintainer"
  }
]
```

## How to convert CSV to JSON

1. Paste CSV with a header row on the first line.
2. Each column header becomes a key; each row becomes one object.
3. Copy the resulting array of JSON objects.

## FAQ

### Does the first row need to be a header?

Yes. The first line is treated as the field names that become the keys of every JSON object.

### How are values typed?

Values are kept as strings to avoid surprises. Cast numbers or booleans afterward if your schema needs them.

## Related converters

- [JSON → CSV](https://www.devkult.com/convert/json-to-csv.md)
- [CSV → SQL](https://www.devkult.com/convert/csv-to-sql.md)
- [YAML → JSON](https://www.devkult.com/convert/yaml-to-json.md)

Open the interactive converter: https://www.devkult.com/convert/csv-to-json