Loading...
Loading...
Convert CSV data to a JSON array of objects. Each row becomes an object and each header becomes a key. Instant browser-side conversion.
The first row of the CSV is treated as the header row. Each subsequent row becomes a JSON object where the keys are the header values and the values are the cell contents from that row. The output is a JSON array containing one object per data row. The result is valid JSON that can be parsed directly with JSON.parse() or any JSON library in any language.
All cell values are output as strings by default. If a cell contains "42", the JSON value is "42" (a string), not 42 (a number). If a cell is empty, the corresponding key has an empty string value. This predictable behaviour avoids silent type coercion surprises when the output is fed into another system.
Seeding a database from a spreadsheet export is one of the most common reasons to convert CSV to JSON. A fixture file in JSON format can be read by seed scripts in Node.js, Python, Ruby, or Go without any CSV parsing library. The keys in each object map directly to database column names.
Sending tabular data as a REST API payload is another frequent use. Many APIs accept a JSON array in the request body when batch-creating records. Converting a CSV of users, products, or transactions to JSON lets you paste the output directly into an API request without writing a parsing script.
Transforming report exports into a format a JavaScript or Python script can process is a third use. D3.js, Pandas, and most data processing libraries have JSON readers built in. Converting the CSV first means you can skip the CSV parsing step in your code entirely.
All values are output as strings by default. Numeric strings like "42" are kept as strings, not auto-cast to numbers. Nested structures are not possible since CSV is flat — each key in the JSON object corresponds directly to one column. If you need numeric types in the output, use the type coercion toggle before converting, which casts values that look like integers or decimals to JSON number literals.
Does the tool auto-detect numeric vs string values?
Not by default. All values are strings. Enable the type coercion option to have the converter output numeric literals for cells that contain only digits and an optional decimal point.
What happens if the CSV has duplicate column names?
If two columns share the same header name, the second column's value overwrites the first in each output object. Rename the duplicate headers in the CSV Editor before converting to avoid losing data.
Can I get an array of arrays instead of array of objects?
Yes. Use the output mode selector to switch to array-of-arrays format, where the first array contains headers and subsequent arrays contain row values in positional order. This format is used by some charting libraries and the Google Sheets API.