CSV to JSON Converter
Turn spreadsheet rows into JSON for an app, a test or an API call. Pick the options, read the result and copy it, all without uploading the file.
- Private: nothing uploaded
- Free
- No sign-up
Runs in your browser. Your files never leave your device.
Paste CSV rows, or drop a file above. The first row can be the column names.
How to use it
Drop a .csv file on the box or paste the rows into the text box.
Check the separator the tool found. Change it if the columns look wrong.
Leave the first row as the header and type detection on, unless you want every value kept as text.
Copy the JSON or download it as a .json file. Pretty and minified are both available.
About this tool
CSV is the lowest common denominator of data: rows of text with a separator. JSON is what a program usually wants. This page does the translation in your browser, with the small rules that matter, such as quotes around a comma inside a field, a newline inside a quoted cell, and a ZIP code that starts with a zero. Your customer list never leaves the device.
How the parser reads a row
A comma is a separator only when it is outside quotes. A field wrapped in double quotes can contain commas, line breaks and doubled quotes, which represent one real quote. Windows files often end their lines with a carriage return and a line feed, and a file saved by Excel may start with a hidden byte order mark. Both are handled. The result is a grid of cells first, and the JSON is built from that grid, which keeps the parsing and the conversion separate and easy to predict.
Headers, missing values and duplicate names
With the header option on, the first row supplies the key names. An empty heading becomes column1 or column2, and two headings with the same name get a suffix, so name and name become name and name_2 instead of one value overwriting the other. A short row is filled with empty strings so every object has the same keys. A long row is not thrown away: extra cells become columns named column9, column10 and so on. If the file has no header row, turn the option off and the keys become column1, column2, and so on.
Numbers, true and false, and leading zeros
Type detection is on by default. A plain number becomes a JSON number, and the words true and false become real booleans. Anything that starts with a zero, such as a ZIP code of 01234 or a customer number of 000451, stays a string, because turning it into a number would delete the leading zero. Numbers longer than 15 digits also stay text, because a JSON number and a spreadsheet both lose digits beyond that point. Turn detection off when every value should stay exactly as typed.
Pretty or minified
Pretty output puts each key on its own line with two spaces of indentation. It is easy to read and to paste into a bug report. Minified output removes every optional space, which makes the file smaller and is what most APIs receive. Both are valid JSON with the same values, and both are built with the browser built in JSON encoder, so quotes and non English characters are escaped correctly.
Separators and file size
The tool counts separators on the first rows and picks the one that gives the same number of columns. A comma separated file with a stray semicolon in a note can confuse that guess, which is why the separator can be set by hand. Files up to 20 MB are accepted. Very large files are slower on a phone because the whole JSON text has to be held in memory before it is shown. To go the other way, use the JSON to CSV converter, and for an .xlsx file with real number cells use the CSV to Excel converter.