CSV TO JSON

Convert a CSV into JSON in the shape your code expects: an array of objects keyed by the header, an array of arrays, or JSON Lines with one object per line. Numbers and true/false values can be typed per column, empty cells can become null, and the output can be pretty printed or compact.

Zero retention: your files never leave this browser. Verify it yourself in DevTools.

Loading the CSV tools.

About CSV to JSON converter

How Can You Verify That Your Files Never Leave This Browser?

You do not have to take our word for it. Browser developer tools list every request a page makes, so you can watch 2csv work and confirm that your data is never sent anywhere. The check takes about a minute.

  1. Open your browser developer tools with F12, or Cmd+Option+I on a Mac, and select the Network tab.
  2. Reload the page and let it finish. You will see the page's own files (including the background file parser), its web fonts, and one anonymous page-view request. No file has been chosen yet, so none of them can contain your data.
  3. Click the clear icon in the Network tab so that the log is empty.
  4. Open a CSV file in the CSV to JSON converter tool above, run it, and download the result.
  5. Look at the Network tab again. It is still empty. Reading, changing, and saving the file made no request at all. For extra proof, turn on offline mode after the page loads: every tool keeps working.

Your file is read into this tab's memory with the browser's own file reader, parsed and changed by code that is already on the page, and handed back to you as a download. It is never uploaded, never stored in the browser, and gone when you close the tab. The only other request the site can make is the feedback form, and only when you submit it.

The production site also sends a Content-Security-Policy header that tells your browser to refuse connections to anywhere except this site and the anonymous analytics endpoint, so even a bug could not send your data elsewhere.

Which JSON Shapes Can You Export?

  • Array of objects: one object per row, with header names as keys. The most common shape for APIs and scripts.
  • Array of arrays: one array per row, values in column order. Compact and order-preserving.
  • JSON Lines: one object per line, with no surrounding array. Good for streaming and log tools.

Header names that are empty or repeated are made unique as keys, as column_N or name_2, so no value is overwritten by another column with the same name. Pretty print adds indentation for reading; leave it off for the smallest file.

How Are Numbers and True/False Detected?

Detect numbers and true/false decides column by column. A column becomes numbers only if every value in it is a plain number. That is why ZIP codes such as 00501 stay as text: one leading zero is enough to keep the whole column as strings, so no value is quietly changed. Empty cells can be written as null.

  1. Clean money columns first with the column type converter, so $1,250.00 becomes 1250.
  2. Turn on Detect numbers and true/false.
  3. Turn on Empty cells as null if your code expects null rather than an empty string.
  4. Check the live preview of the real first rows.

What Happens When a Filter Is On?

The export uses the rows the grid shows. If a filter is active, the JSON contains only the matching rows, and the export bar says so. That makes it easy to pull a subset, such as orders above a dollar amount, straight into JSON without changing the table. Clear the filter in Filter CSV to export everything.

How Do You Go Back From JSON to CSV?

The reverse direction has its own page, JSON to CSV, which flattens nested objects into dotted column names. The same export bar also writes TSV and SQL, so one open file can become several formats in a row. For formats other than CSV and JSON, 2convert handles the conversion in the same browser-only way.

What Else Can You Do With a CSV Here?

  • CSV viewer: Open a CSV of any size, scroll every row, and see a profile of each column.
  • Sort CSV: Sort rows by one or more columns, as text, numbers, or dates, ascending or descending.
  • Filter CSV: Show only the rows that match an expression such as price > 10 AND state = "NY".
  • CSV validator: Find ragged rows, broken quotes, bad headers, encoding problems, and values of the wrong type.
  • Remove duplicates from CSV: Find and remove duplicate rows, comparing whole rows or only the columns you choose.
  • Trim CSV whitespace: Trim leading and trailing spaces, collapse double spaces, and drop invisible characters and empty rows.
  • Find and replace in CSV: Find text in one column or every column and replace it, with match case, whole cell, and regex options.
  • Remove rows from CSV: Delete rows by number or range, the first or last rows, empty rows, or rows that match a rule.
  • CSV editor: Edit cells, add or delete rows, and add, delete, rename, or move columns.
  • Split CSV column: Split one column into several at a delimiter, such as a full name into first and last.
  • Merge CSV columns: Join two or more columns into one with the separator you choose, skipping empty values.
  • CSV column type converter: Convert a column to clean numbers, ISO dates, true/false, or upper, lower, or title case.
  • JSON to CSV converter: Convert a JSON array or JSON Lines to CSV, flattening nested objects into dotted column names.
  • CSV to SQL converter: Turn a CSV into SQL INSERT statements, with an optional CREATE TABLE, for PostgreSQL, MySQL, SQLite, or SQL Server.
  • CSV to TSV converter: Convert a comma-separated file to tab-separated values that paste cleanly into spreadsheets.
  • TSV to CSV converter: Convert a tab-separated file to a standard, properly quoted comma-separated CSV.
  • CSV splitter: Split a large CSV into smaller files of a set number of rows, with the header repeated in each.

All eighteen tools are on the 2csv home page, and once a file is open you can switch between them without reloading it. Part of the 2suite.io privacy-first ecosystem.

Frequently Asked Questions

Will ZIP codes lose their leading zeros?

No. A column becomes numbers only when every value is a plain number, so a ZIP code like 00501 keeps the whole column as text.

What is JSON Lines?

A format with one JSON object per line and no surrounding array. Many log, streaming, and data tools read it one line at a time.

What happens to repeated column names?

They are made unique as keys, such as name_2, and empty names become column_N, so no value overwrites another.

Can I copy the JSON instead of downloading it?

Yes. The export bar can copy the output to your clipboard or download it as a file.

Can empty cells become null?

Yes. Turn on the empty cells as null option and blank cells are written as null instead of an empty string, which many APIs and databases expect.

Was this helpful?