# CSV ↔ JSON converter

Canonical page: https://datalens.flazetech.in/csv

Publisher: DataLens by Flazetech (https://datalens.flazetech.in/about).

Convert CSV to JSON objects or a JSON array back to CSV. Preserve table headers, quoted fields, and leading zeroes while moving between spreadsheet and API data.

## How to convert CSV and JSON

1. Choose CSV to JSON or JSON to CSV.
2. Paste a table with unique column headers, or a JSON array of objects.
3. Select Convert, then copy or download the result. CSV values remain strings to preserve leading zeroes.

## Worked example

### Example input

```text
id,name
001,Alex
002,Sam
```

### Example output

```text
[
  {"id":"001","name":"Alex"},
  {"id":"002","name":"Sam"}
]
```

## Common questions

### How are CSV column headers used?

The first row becomes the property names in each JSON object. Headers must be unique, and each data row must have the same number of fields. Empty headers receive generated column names.

### Are commas inside quoted fields supported?

Yes. Double-quoted fields can contain commas and line breaks. An embedded double quote is escaped as two double quotes. The JSON to CSV converter applies this escaping to both headers and values.

### Will CSV to JSON keep leading zeroes?

Yes, if the zeroes are present in your source text. CSV values stay strings, so 001 becomes "001" rather than 1. The converter cannot recover digits that a spreadsheet removed before export.

### Can I convert JSON to CSV for Excel?

Yes. Choose JSON to CSV and provide an array of objects. Property names become headers. Nested arrays and objects are serialized as JSON text in a cell rather than flattened into new columns. Review the CSV in your spreadsheet before using it.

## Related guides

- [Convert an Excel column to a comma-separated list](https://datalens.flazetech.in/guides/excel-column-to-comma-list)
- [Convert CSV to JSON without losing field values](https://datalens.flazetech.in/guides/csv-to-json-preserve-values)

## Data handling

[Processing and privacy](https://datalens.flazetech.in/privacy). Formatting and conversion run in the browser. Optional sharing and API requests can transmit supplied data. The interactive tools require JavaScript; this reference does not.
