Formatomat

Convert CSV to JSON

Turn your CSV files into JSON files in seconds. Conversion happens in your browser, so your files are never uploaded to a server.

  • Files never uploaded
  • Free, no sign-up
  • No queue

or drop them here. You can also paste an image (Ctrl+V).

Free · No sign-up · No upload

How to convert CSV to JSON

  1. 01

    Add your CSV files

    Click “Choose CSV files” or drop them on the page. You can add several at once.

  2. 02

    Check the JSON format

    JSON is already selected. Each table row becomes an object, with the headers as keys.

  3. 03

    Convert and download

    Click “Convert”, then download your JSON file. With several files, grab everything at once as a ZIP.

CSV to JSON: what to know

Converting CSV to JSON is a way to feed a web app, an API, a static site generator or a test dataset from a spreadsheet export. The result is an array of objects, indented to stay readable, with every object listing all the columns in order, except a column with neither a title nor a value. Headers become keys exactly as written, spaces and accents included; an empty header becomes col followed by the column number, and a duplicate gets the suffix _2, or _3 if _2 already exists, which a message points out. A title alone on its line above the table and followed by an empty line is left out: the keys are the column titles below it, and a message says so. Likewise, the information lines of a statement above the table (account number, period, balance), separated from it by an empty row, are left out: the keys are the table’s column titles, and a message says how many lines were left out, quoting the first.

Numbers become real JSON numbers, including decimal commas in a semicolon file, and empty cells become null. Everything else is a string: dates, true and false, percentages, amounts with currency symbols (an amount such as 1 250,50 becomes a number). Values with leading zeros and identifiers of 16 digits or more also stay strings, so nothing is lost, the identifiers pointed out on the file’s row; the same column can therefore mix numbers and strings, worth checking if your code expects a single type.

CSV vs JSON: what’s the difference?

CSVComma-Separated Values

A plain text file where each line is a table row, with values separated by commas or semicolons. It is the most universal data exchange format.

JSONJavaScript Object Notation

The structured data format used by websites and apps (APIs). Both people and programs can read it.

CSV to JSON: frequently asked questions

My CSV has no header row. How do I convert it to JSON?

If its first row holds only numbers, there is nothing to do: it is not taken for headers, it stays a record, the columns take the keys col1, col2…, and a message says so; the same goes for a single-line file. If it holds text, dates included (a CSV stores them as text), it is used for the keys: add a header row first, in a text editor or a spreadsheet, or its values would turn into property names.

Are cells containing commas or line breaks converted properly?

Yes, as long as they are in quotes, as the CSV format requires and as spreadsheet apps do when exporting. The text stays in a single value, with its line breaks encoded as \n in the JSON, and doubled quotes inside a field go back to single quotes. An opening quote that is never closed (a malformed file) is kept as text and the rest of the file is read line by line; a message quotes the line to check. A quoted field that runs over several lines stays one value, and a message quotes its lines: a warning when these lines look like lines of the file or the quote that closes it follows a digit, like the inch mark of 12", except in a file whose fields are all quoted, where that quote does close the field.

Are my CSV files uploaded to the internet?

No. The file is read and converted by your browser, on your device. Nothing is sent to a server, and nothing is kept after you close the page.

Does converting CSV to JSON reduce quality?

No. Each filled row becomes a JSON object, with the headers as keys (col1, col2… when the first row holds only numbers: it then stays a record); an empty row gives no record, which a message points out. Numbers stay numbers, except codes with a leading zero (01234) and those of more than 15 digits or beyond a spreadsheet’s limits, kept as text as written; a value that looks like a number without being written like the file’s (1 250.50 among decimal commas) stays text too, and the row points it out in a column of numbers.

How many CSV files can I convert?

As many as you like, for free and without signing up. Add them all, then download the results one by one or in a single ZIP. The maximum size depends on your device and browser, with a few caps that protect its memory (for example 20,000 files per archive or 5 million filled cells per workbook: see the home page FAQ); a file over one of them is not converted, and a message says so.

Does it work on iPhone and Android?

Formatomat is designed for recent browsers on computers, iPhone and Android, with no app to install. A conversion the browser cannot do (a format it cannot read or write) is refused with a message that says so.