CSV ⇄ JSON Converter
Convert CSV data (first row treated as headers) into a JSON array, or a JSON array into CSV. Handy for wiring Excel/Google Sheets exports into APIs.
How to use it
- Choose comma, semicolon, or tab as the delimiter used by the file.
- Paste CSV or a flat JSON array, open a local file, or load the CSV example.
- Select CSV → JSON or JSON → CSV.
- Review the row count, then copy, download, or send JSON output to Sort Keys.
CSV to JSON example
name,city,active
Ada,"Paris, France",true
Grace,New York,false
The first row becomes object keys and each following row becomes one object:
[
{"name":"Ada","city":"Paris, France","active":"true"},
{"name":"Grace","city":"New York","active":"false"}
]
CSV does not carry reliable type metadata, so values become JSON strings. Convert booleans, numbers, dates, and nulls explicitly in the consuming application when their types matter.
Quoting and delimiters
A field containing the selected delimiter, a quote, or a newline must be wrapped in double quotes. A literal quote inside that field is written twice, for example "Ada ""The First"" Lovelace". The parser supports these common CSV quoting rules and Windows or Unix line endings.
Select the delimiter that actually separates the source columns. Semicolon-separated exports are common when the locale uses a comma for decimals, while tab-separated data often comes directly from spreadsheets.
Validation that prevents data loss
Every data row must contain the same number of fields as the header. Rows with missing or extra columns are rejected with their row number instead of being padded or truncated. Empty and duplicate header names are also rejected because they would produce ambiguous JSON properties. An unclosed quoted field returns a CSV parse error.
JSON to CSV requires a non-empty or empty array of flat objects. Nested objects and arrays are rejected rather than converted to the meaningless text [object Object]. Flatten nested data first when a tabular export is required.
Common CSV conversion errors
- Column mismatch: inspect quoting and delimiters on the reported row.
- Duplicate header: rename one column before converting to JSON.
- Unclosed quoted field: add the closing quote or escape an internal quote by doubling it.
- Expected a JSON array: wrap row objects in
[ ]before JSON-to-CSV conversion. - Nested JSON value: flatten or serialize that field intentionally before export.
When to convert CSV and JSON
Use the converter to prepare spreadsheet exports for APIs, inspect tabular reports as structured data, build development fixtures, or create a CSV file from a flat API response. Conversion runs locally in the browser and the file contents are not uploaded to Cryonel.
Frequently Asked Questions
What happens if a value contains a comma?
Wrap the value in double quotes ("Paris, France") — the tool supports RFC 4180-style quoting.
Can I use a different delimiter (semicolon, tab)?
Yes, pick one from the dropdown above — European-format Excel CSVs typically use a semicolon.
Why was a CSV row rejected?
Every data row must have the same number of columns as the header row. The converter rejects mismatches instead of silently dropping extra values or inventing missing data.