# CSV and JSON Converter Guide

Convert CSV to JSON, or JSON back to CSV, with configurable delimiter and pretty-printing.

- Tool: https://ilham.dev/tools/csv-json-converter/
- Guide URL: https://ilham.dev/guides/csv-json-converter/
- Tool guides index: https://ilham.dev/guides/tools/
- Broader guide: Working With Structured Data (https://ilham.dev/guides/working-with-structured-data/)

## What it does

Move between the two shapes that CSV and JSON use for tabular data. Going to JSON, each row becomes an object keyed by the header; going to CSV, the keys become the header and any key a row is missing is left empty. The delimiter is detected for CSV input and can be set by hand.

## Use the tool

Open https://ilham.dev/tools/csv-json-converter/, add the input the tool asks for, run it, and check the output before using it elsewhere.

## Input and output

- Input: text.
- Output: text.
- Category: Data.

## Privacy and processing
Processing happens locally in your browser. This tool does not upload the input to ilham.dev.

## Questions

### What does the JSON have to look like?

An array. Each item can be an object, whose keys become columns, or an array, which is written as a plain row. Anything that is not an array is rejected with a message rather than a partial result.

### Where does the extra header come from?

When objects have different keys, the header is the union of all of them, in the order the keys first appear. A row that lacks one of those keys simply gets an empty cell.

### Are values converted to numbers?

No. CSV cells are text, so 120 in a CSV file becomes the string "120" in JSON. Convert the types in your own code if the number matters.