CSV ↔ JSON Converter Online

Convert CSV to JSON or JSON to CSV instantly in your browser.

CSV INPUT0 chars
JSON OUTPUT

When a CSV ↔ JSON converter is the right tool

A lot of lists travel as CSV from a spreadsheet and as a JSON array in an API. A converter is for moving between those two shapes in the browser: paste CSV with a header row and get a pretty-printed array of objects, or paste an array of objects and get CSV back. The output updates as you type.

The CSV reader is intentionally simple. It works well on plain files whose fields do not contain commas. If you need a tab or semicolon delimiter, a union of keys from every row, or a downloadable file, use the dedicated JSON to CSV page for the JSON-to-CSV direction.

Use cases

Turning a spreadsheet export into JSON

Paste a header line and the rows beneath it, leave the direction on CSV → JSON, and copy the array. Numbers and empty cells arrive as strings. Load Sample pastes a short name/age/city table if you want to try that first.

Turning a JSON array into a simple CSV

Switch to JSON → CSV and paste an array of objects. The first object decides the columns. This is enough for a uniform list; it is the wrong tool if later objects have extra keys you care about — use JSON to CSV in that case.

A quick round trip on clean data

After a successful conversion, Swap flips the direction and uses the output as the new input. On a simple table, you can check that names and cities survive. Remember that ages will have become strings, and quoted commas will not survive the read path.

How conversion works

CSV → JSON trims the text, splits on newlines, takes the first line as headers, and splits each data line on commas. Cells are trimmed and lose a single pair of surrounding quotes if present. JSON → CSV parses the text as JSON, requires an array of objects, and writes a header from Object.keys of the first row, then one line per object. The conversion is live. Switching the direction buttons clears the input; Swap does not.

Example — a simple table becomes an array of string fields
name,age,city
Alice,30,New York
Bob,25,London

[
  {
    "name": "Alice",
    "age": "30",
    "city": "New York"
  },
  {
    "name": "Bob",
    "age": "25",
    "city": "London"
  }
]

age is "30", not a number. That is expected: this converter does not guess types.

Example — a quoted comma that the CSV reader will misread
name,city
Alice,"New York, NY"

A strict CSV parser would treat "New York, NY" as one city. This reader splits on the comma inside the quotes, so the row looks like it has an extra column and the JSON will be wrong. Clean or convert those files another way first.

What this tool does not do

It does not parse quoted commas, other delimiters, or types, and it does not take columns from every JSON object — only the first. Nothing is sent to a server. There is no download button here. For a comparison of two CSV files, use CSV Diff; for column statistics, use CSV Column Stats.

How to use CSV ↔ JSON Converter

  1. Choose CSV → JSON or JSON → CSV. Switching tabs clears the input.
  2. Paste the source, or use Load Sample for a short example in the current direction.
  3. Copy the result when it looks right, or Swap to convert the output back the other way.
  4. Use Clear to empty the input.

Frequently asked questions

How does CSV → JSON work?

The first line is treated as headers. Each later line is split on commas, trimmed, and turned into an object. Surrounding quotes on a cell are stripped, but a comma inside quotes is still treated as a separator. Every value is a string, even if it looks like a number. The file must have a header and at least one data row.

How does JSON → CSV work?

The input must be a JSON array of objects. Column names are taken only from the keys of the first object; keys that appear only on later rows are dropped. Nested objects are written as the string [object Object]. Empty arrays produce empty output rather than an error. Cells that contain a comma, a quote, or a newline are quoted, and quotes inside a cell are doubled.

Does the CSV side understand quoted commas, tabs, or semicolons?

Not when reading CSV. The parser splits each line on every comma. A field such as "New York, NY" becomes two columns. Tab-separated or semicolon-separated files are not treated as a different dialect. When writing CSV, quoting is applied; when reading, it is not a full RFC 4180 parse.

How is this different from the JSON to CSV page?

This page converts in both directions and always uses a comma. The JSON to CSV page only goes from JSON to CSV, but it unions keys from every object, lets you choose comma, semicolon, tab, or pipe, and can download a .csv file. Use that page when you need a different delimiter or a complete set of columns.

What do the mode buttons and Swap do?

The CSV → JSON and JSON → CSV buttons switch direction and clear the input. Swap, when output is available, flips the direction and puts the current output into the input so you can convert back. Load Sample pastes a short example for the current direction.

Is my data sent to a server?

No. Conversion runs in your browser as you type. Closing the tab discards what you pasted. Do not paste spreadsheets that contain personal data or secrets if you would not be comfortable with them sitting in memory on this device.

Is there a file size limit?

There is no server-imposed limit, because nothing is uploaded. A few thousand rows is usually comfortable. A very large export can make the tab feel slow; in that case, convert a smaller excerpt or use a local tool.

Related tools and guides

References

  • RFC 4180 describes quoted CSV fields that may contain commas. This page does not implement the full quoting rules when reading CSV; it splits each line on every comma.
  • Spreadsheet tools and dedicated CSV libraries handle quoted commas, encodings, and custom delimiters more reliably when your export is not a simple comma-separated list.