Skip to main content
NyankoTools

CSV ⇔ JSON Converter

Paste CSV to convert it to a JSON array, or paste a JSON array to convert it to CSV. The header row is used as the JSON keys, which is handy when you want to turn a spreadsheet export straight into JSON for an API. To further format or validate the resulting JSON, try the JSON Formatter as well.

🔒 Runs in your browser · Your data is never sent to a server

Notes

  • The first CSV row is treated as the header (keys). A data row with a different number of columns causes an error.
  • When converting CSV to JSON, every value is output as a string. Numbers and booleans are not converted.
  • JSON to CSV only supports arrays of objects. Nested objects and arrays are placed in the cell as JSON strings.

Glossary

CSV

Short for Comma-Separated Values, a text format that separates columns with a comma (or another delimiter). Widely used as the export format for spreadsheets like Excel.

JSON

Short for JavaScript Object Notation, a text format for representing data as key-value pairs. It is widely used for APIs and configuration files.

Header row

The first row of a CSV file, containing the name of each column. This tool uses the header row's values as the JSON keys.

Quoting

When a CSV field contains a comma or a newline, the whole field is wrapped in double quotes ("). A double quote inside the value is escaped by doubling it ("").

FAQ

Are numbers in CSV converted to JSON numbers?

No. When converting CSV to JSON, all values are output as strings. Convert types on the consuming side if you need numbers or booleans.

Does it work with delimiters other than commas?

Yes. You can choose between comma and tab (TSV) delimiters. Values containing delimiters or line breaks are handled with standard double-quote rules.

Why do I get a column count mismatch error?

A data row has a different number of columns than the header. This often happens when a value contains a comma but is not wrapped in double quotes. Use the reported row number to find it.

Share this page

↑↓ Select Enter Open Esc Close