CSV ⇄ JSON
Convert either way, turn either into SQL INSERT statements, open an Excel workbook (.xlsx) as CSV or save the data as one, view it as a table you can sort and filter, or transpose, reorder and pivot its columns.
About this tool What it's for, how to use it and an example
What it's for
Convert CSV to JSON and JSON to CSV, and Excel workbooks to and from CSV. CSV is what spreadsheets export; JSON is what most APIs and scripts expect.
For example, when you’ve exported a spreadsheet and need the rows as JSON for a script or an API request, or have JSON from an API that you want to open in Excel or Numbers.
How to use it
Paste CSV or JSON and choose CSV → JSON or JSON → CSV. The delimiter is detected automatically when reading CSV (comma, tab, semicolon or pipe), or you can choose one. With First row is column names ticked, each row becomes an object keyed by the column names; untick it to get plain arrays. Quoted fields containing commas, quotes and line breaks are handled properly. Going to CSV, the columns come from the objects’ keys.
To SQL writes the CSV or JSON as SQL that creates a table named data and inserts the rows, the same SQL the SQLite Viewer uses when it loads a CSV. Each column’s type (INTEGER, REAL or TEXT) comes from its values, and a blank cell or a JSON null becomes NULL.
Open a spreadsheet takes an Excel workbook (.xlsx), a CSV or a TSV, or one dropped on the page. A workbook’s sheet becomes CSV in the box (choose another under Sheet when it has several), ready to convert or show as a table. Save as Excel (.xlsx) saves the CSV or JSON in the box as a one-sheet workbook.
Show as a table lays the CSV or JSON out as a table. Choose a column’s name to sort by it (numbers as numbers, text in natural order), and again to reverse it; type in Filter the table to show only rows containing that text. Transpose turns rows into columns. Delete columns, Move columns and Swap two columns take the columns to use in Columns, as names or numbers counting from 1, separated by commas; Move columns puts them at Move to position. Change delimiter rewrites the data with the Output delimiter. Pivot groups the rows by Group by column and works out the Aggregate (count, sum, average, minimum or maximum) of Aggregate column for each group. All of these write CSV into Result, using the output delimiter, from the CSV or JSON in the box.
Example
Paste this and choose CSV → JSON:
name,city,age
Alice,"London, UK",34
Bob,Leeds,28
The tool reports 2 rows, split on commas. and gives two objects. The quoted "London, UK" stays as one value
instead of being split at its comma.
Good to know
Values stay as text, so 34 becomes "34", not a number. Nested JSON values (objects or arrays inside a row) are written into their cell as JSON text. The SQL quotes names with double quotes and wraps the inserts in BEGIN; and COMMIT;, which SQLite, PostgreSQL and SQL Server accept; MySQL needs its ANSI_QUOTES mode for the quoted names. Rename the table from data before you run it.
From a workbook, each cell’s stored value is used, not its display: numbers keep up to 15 significant digits whatever decimal places the sheet shows, cells formatted as dates become 2026-01-31 (with 14:30:00 when there’s a time), and a formula gives its last calculated result. Older .xls files aren’t read. A saved workbook has no formatting; plain numbers are saved as numbers and everything else as text, so a code such as 007 keeps its zeros.
Pivots count rows, or add numbers with thousands commas such as 1,200; blank cells are skipped and any other text in a column being summed, averaged or compared is reported as an error. Column names containing a comma can’t be chosen by name; use their number. Without First row is column names ticked, columns are named Column 1, Column 2 and so on.
Guides: Loading learning data into SuccessFactors with connectors · From a messy CSV to clean data · Opening a Parquet, SQLite or Excel data export · Making test data for a demo or test system
Column tools work on the CSV or JSON above and write CSV. Name columns by their names or numbers, separated by commas.
Values stay as text. Nested JSON values become JSON text in their cell.
Built with The third-party code and data this tool uses, and their licences
This tool uses no third-party code or data of its own: its code was written for this site.
Every page also uses Montserrat (SIL Open Font License 1.1).
Everything the site uses is on Credits and licences.
Private: this tool runs in your browser. Nothing you type, paste or choose leaves this page.
Saved you a few minutes? Say thanks with a coffee.
Something wrong with this tool, or missing from it? Report a bug or suggest a feature.