Skip to content

CSV to JSON Converter

Convert CSV into a JSON array of objects using the header row as keys, with full support for quoted fields, or convert JSON back into CSV.

Runs in your browser Free, no sign-up
Loading tool workspace...

What is CSV to JSON Converter?

This CSV to JSON converter turns spreadsheet-style data into JSON and back. CSV to JSON reads the first row as column names and turns every following row into a JSON object, producing an array such as [{"name": "Ada", "role": "admin"}, …], the shape most APIs, seed scripts and front-end components expect. Quoted fields with commas, quotes or line breaks inside them, such as "Smith, John", are read correctly, and comma, semicolon, tab and pipe delimiters are detected automatically.

JSON to CSV does the reverse: give it an array of objects and it writes a header row with every key that appears in any object, one CSV row per object, and flattens nested objects into columns such as address.city, ready to open in Excel or Google Sheets.

How to use CSV to JSON Converter

  1. Choose CSV → JSON or JSON → CSV, or click Load Sample to see an example.
  2. Paste your CSV (with a header row) or your JSON array of objects.
  3. Read the converted output and the row and column count; for CSV → JSON, choose whether numbers and booleans are typed or kept as text.
  4. Copy or download the result.

Key features

  • CSV to JSON and JSON to CSV
  • RFC 4180 parsing: quoted fields with commas, quotes and line breaks
  • Automatic comma, semicolon, tab or pipe delimiter detection
  • Optional typed numbers and booleans, without losing leading zeros
  • Nested JSON flattened into columns such as address.city
  • Runs entirely in your browser

Common use cases

  • Turning spreadsheet exports into JSON seed data or fixtures
  • Converting API JSON responses into CSV for Excel or Google Sheets
  • Preparing JSON for charting and table components
  • Importing CSV data into document databases
  • Sharing API data with non-technical colleagues as a spreadsheet

Technical details & standards

CSV is parsed according to RFC 4180: a field wrapped in double quotes may contain the delimiter, line breaks and doubled quotes ("" stands for one "), CRLF and LF line endings are both accepted, a byte order mark is ignored and blank lines are skipped. The delimiter is detected from the first rows by finding the character (comma, semicolon, tab or pipe) that splits them into the most consistent number of columns. Empty or duplicate header names get unique names such as column_3 and id_2, and rows with extra cells get extra columns. With typed values on, 42 becomes a number and true a boolean, but only when nothing is lost, so ZIP codes like 007, 1.50 and very long IDs stay strings.

JSON to CSV accepts an array of objects, an array of arrays, a single object or an object holding one array (such as {"data": [...]}). Columns are the union of all keys in first-seen order, nested objects become dot-separated columns, arrays are written as JSON text and null becomes an empty cell. Fields containing a comma, quote, line break or leading or trailing space are quoted with inner quotes doubled, following RFC 4180.

Frequently asked questions

What JSON format does CSV convert to?

An array of objects, one per data row, with the header row's column names as keys: [{"id": 1, "name": "Ada"}]. Numbers and booleans are typed by default; switch values to all text to keep every value a string.

Can I convert CSV with commas inside quoted values?

Yes. Fields wrapped in double quotes can contain commas, line breaks and doubled quotes, as Excel and Google Sheets export them, so "Smith, John" stays one value.

Does it work with semicolon or tab separated files?

Yes. The delimiter is detected automatically from the first rows, so semicolon-separated exports from European versions of Excel and tab-separated data convert without changing any settings.

What JSON can be converted to CSV?

An array of objects, like an API list response. Every key that appears in any object becomes a column, and nested objects are flattened into dot-separated columns such as address.city; arrays inside objects are written as JSON text.

How do I open the CSV in Excel?

Download or copy the CSV into a file with the .csv extension and open it. If special characters display incorrectly, use Data > From Text/CSV and choose UTF-8 encoding.

Is my data safe?

Processing happens locally in your browser. Tool input is not sent to CodeUnpack servers.

Does it work offline?

Once the page has loaded, this tool can process input without an internet connection.

More converters tools

View all