CSV to JSON

Paste CSV or open a file and get a JSON array with one object per row, keyed by the header. Choose whether numbers and true/false become real JSON values or stay text.

How it works

The text is read in a background worker, so a large file does not freeze the page. The tool tries comma, semicolon, tab and pipe on the first rows and picks the one that splits every row into the same number of columns. You can also pick the separator yourself.

The first row becomes the keys. A column with no name is called column_1, column_2 and so on, and a repeated name gets _2 added, so no value overwrites another. Blank lines are skipped.

With typed values on, a cell is turned into a number or a boolean only when nothing is lost: 42 and 3.5 become numbers, true and false become booleans, and an empty cell becomes null. 02139, +44 and 1,000 stay text, and so does a whole number too long for JavaScript to store exactly.

How to use it

  1. 1 Paste CSV into the box, open a .csv, .tsv or .txt file, or drop one onto the box.
  2. 2 Check that the separator was detected correctly. The first note under the options says what it was read as.
  3. 3 Choose typed values or every value as text.
  4. 4 Copy the JSON, or download it as a .json file named after your CSV.

Good to know

  • If your IDs or phone numbers must stay exactly as written, choose every value as text. Your code can then convert the columns it knows are numbers.
  • A row with fewer cells than the header still gets every key. The missing ones are null with typed values, or empty text without.
  • A row with more cells than the header keeps its extra values under keys such as column_6, so nothing is silently dropped. The notes say how many rows that happened to.
  • Exported from Excel and seeing odd characters? Save the file as "CSV UTF-8" and open it again.

Browser support

  • Chrome 94 and later
  • Firefox 93 and later
  • Safari 16.4 and later
  • Edge 94 and later

These are the oldest versions with everything the tool uses. They are worked out from the tool itself, so they change when it does.

Version numbers checked on 2026-09-04.

Turning CSV into JSON without changing your data

CSV and JSON look like they hold the same thing, a list of records, but they disagree about what a value is. In a CSV file every cell is text. The file has no way to say that 42 is a number and 02139 is a postcode. JSON does have types, so whoever converts one into the other has to decide what each cell means. Most converters decide by guessing, and the guesses are where data goes wrong.

The classic failure is the leading zero. A converter that sees 02139 and thinks "number" writes 2139, and the Boston postcode is gone. The same thing happens to product codes, phone numbers with a leading zero and account numbers. A second failure is length. JavaScript stores numbers as 64-bit floating point, which holds whole numbers exactly only up to 9,007,199,254,740,991. An order ID of 12345678901234567890 turns into 12345678901234567000 when it is read as a number, and nothing tells you.

This tool makes the guessing narrow and visible. With typed values on, a cell becomes a number only when it is written the way JSON writes numbers: an optional minus sign, no leading zero, an optional decimal part and exponent. True and false, in any capital letters, become booleans. An empty cell becomes null. Everything else, including 02139, +44 20, 1,000 and any integer past the safe limit, stays text. If even that is too much, choose every value as text and the JSON holds exactly the characters that were in the file.

The header row needs care too. Spreadsheets are happy with two columns called Name or a column with no name at all, but a JSON object cannot hold the same key twice. The tool names an empty header column_N, after its position, and adds _2 to a repeated name, then lists each change in the notes. Rows that are shorter than the header are filled with empty values so every object has the same keys. Rows that are longer keep their extra cells under numbered keys instead of losing them.

Reading the CSV correctly comes first. The separator is found by checking which of comma, semicolon, tab and pipe splits the first rows into an equal number of columns. Counting characters is not used, because a comma file full of addresses can hold more semicolons than commas. Quoted cells may contain the separator, line breaks and doubled quote marks. A quote that never closes stops the conversion with its row and line, so you can fix it instead of getting one enormous cell. The whole job runs in a worker on your device and nothing is uploaded.

Frequently asked questions

Why did my ZIP code or phone number stay as text?

A number with a leading zero, such as 02139, would lose the zero as a JSON number. The tool leaves it as text on purpose. Values with a plus sign, spaces or thousands separators stay text for the same reason.

Does it handle commas and line breaks inside a cell?

Yes. A cell in double quotes can hold the separator, line breaks and doubled quote marks (""), as the CSV standard (RFC 4180) describes. If a quote is opened and never closed, the tool stops and names the row and line, because everything after it would be read as one cell.

Is my CSV uploaded?

No. The file is read by your browser and converted in a worker on this page. Nothing is sent to YappyKit or anyone else.

How big a file can it take?

Up to 5 MB of text. That is tens of thousands of rows for most files. For anything larger, split the file and convert it in parts.

Related tools

Your files are processed on your device and are not uploaded. You can verify this in your browser’s developer tools under the Network tab.