CSV to JSON Converter

Convert data sets between CSV and JSON instantly and locally.

CSV
JSON

Written and maintained by the KitYards team About KitYards Last reviewed:

This converter turns a CSV table into a clean JSON array and a JSON array back into a CSV table, both directions, in a single click. It detects the delimiter automatically (comma, semicolon, tab or pipe), honours quoted fields that contain commas or line breaks, and can treat the first row as the header so every record becomes a properly keyed object. Numbers, booleans and nulls are recognised as real JSON scalars instead of strings. Everything runs in your browser: the spreadsheet you paste never reaches a server.

How to convert CSV to JSON

  1. 1 Pick the direction: CSV → JSON or JSON → CSV.
  2. 2 Paste your data into the left panel — or drop in an export from Excel, Sheets or a database.
  3. 3 Adjust the delimiter and the header-row option if the preview does not look right.
  4. 4 Copy the result or download it as a .json / .csv file.

How the conversion handles real-world CSV

The parser follows RFC 4180, the specification that defines what CSV actually is. That matters because the naive approach — splitting each line on commas — breaks on the first field that contains a comma inside quotes, which in practice means the first address or the first company name with a comma in it. This parser tracks whether it is inside a quoted field, so a quoted value may legitimately contain the delimiter, a line break, or an escaped quote written as two quote characters in a row.

The delimiter is detected rather than assumed. The first non-empty line is scanned for commas, semicolons, tabs and pipes, counting only occurrences outside quoted regions, and the most frequent candidate wins. This handles the common European export where Excel uses semicolons because the comma is the decimal separator — a file that a comma-only parser mangles into a single column.

Two options change the shape of the output. With the header option on, the first row becomes object keys and each subsequent row becomes an object; with it off, rows become plain arrays. Type inference, when enabled, converts 123, true and null into real JSON scalars rather than leaving everything as strings — useful for a clean API payload, and something to turn off when your data contains values that only look numeric.

Common conversions

Spreadsheet into an API payload

A colleague sends an export; your endpoint wants JSON. Converting with headers on and type inference enabled produces an array of objects that most APIs accept directly.

API response into a spreadsheet

Going the other way turns a JSON array into something you can open in Excel, Numbers or Sheets and hand to somebody who does not read JSON.

Seeding test data

Fixtures are easier to maintain as a spreadsheet than as hand-written JSON. Edit the CSV, convert, and paste the result into your test suite.

Inspecting an unfamiliar export

Converting to JSON and formatting it makes the structure of a strange file obvious — particularly which columns are actually populated and which are empty throughout.

Why convert CSV and JSON in the browser

CSV is what spreadsheets and analytics exports speak; JSON is what APIs, config files and JavaScript speak. Moving between them is a daily chore for developers, data analysts and anyone wiring a spreadsheet into an application. Most online converters upload your file to a server — a real problem when the rows contain customer records, invoices or anything under NDA. Here the parsing happens locally with a strict RFC 4180 reader, so quoted fields, embedded newlines and escaped quotes survive the round trip, and your data never leaves the tab.

Where CSV and JSON do not line up

The two formats do not describe the same shapes, and the mismatch causes most conversion surprises:

  • CSV is flat; JSON nests. A JSON array of objects converts cleanly, but nested objects and arrays have no natural column representation — they are flattened or serialised, and the structure is not recoverable by converting back.
  • CSV has no types. Everything in a CSV file is text. Type inference guesses, and a guess can be wrong: a product code like 007 becomes 7, and a long numeric identifier can lose precision. Turn inference off for identifier columns.
  • Leading zeros and long numbers are the classic data-loss case. If a column holds phone numbers, postcodes or account numbers, keep it as strings.
  • Dates are not converted. They pass through as whatever text the source contained, in whatever regional format that was.
  • Very large files are limited by memory. The whole document is parsed at once, so a file of several hundred megabytes is better handled by a streaming tool on the command line.

Troubleshooting

Everything landed in one column
The delimiter was misdetected, which happens when the first line is unrepresentative — a title row, or a single field with no separators. Set the delimiter explicitly. European Excel exports are usually semicolon-separated even though the file is called .csv.
My leading zeros disappeared
Type inference converted the column to numbers, and 00123 as a number is 123. Turn type inference off, or quote those values in the source. This is the same behaviour that silently corrupts postcodes in spreadsheets, so it is worth catching before the data goes anywhere.
The row count is wrong
Usually a quoted field containing a line break, which is valid CSV but looks like a row boundary to anything less careful. This parser handles it correctly — if your count differs from another tool, this one is likely the one that is right. Unbalanced quotes in the source will genuinely break parsing, and the error message points at where.

Frequently asked questions

Is my file uploaded anywhere?

No. The conversion is pure JavaScript running in your own browser. Nothing is sent to a server, so the tool works offline once the page has loaded.

Does it handle commas or line breaks inside a field?

Yes. The parser follows RFC 4180: any field wrapped in double quotes may contain the delimiter, newlines and escaped quotes ("") without breaking the table.

What happens to numbers and booleans?

Values such as 42, 3.14, true and null become real JSON types. Anything ambiguous — leading zeros, phone numbers, IDs — is kept as a string so no information is lost.

Can it convert nested JSON to CSV?

Only imperfectly, and that is a limitation of CSV rather than of the tool. A flat array of objects maps cleanly onto rows and columns. Nested structures have to be flattened or serialised into a cell, and converting the result back will not reconstruct the original shape — if the nesting matters, keep the data as JSON.

Which delimiter should I use?

Comma is the international default and what most APIs and programming libraries expect. Semicolon is what Excel produces and expects in locales that use the comma as a decimal separator, which is most of continental Europe. If you are sending a file to someone in Spain, France or Germany to open in Excel, semicolons will save them a frustrating import dialog.

Does it handle quotes and commas inside fields?

Yes — that is the main reason to use a real parser. A field wrapped in quotes may contain commas, line breaks and quote characters, the last escaped by doubling them. This is exactly where hand-rolled splitting on commas falls apart, usually on the first row containing an address.

Is my data uploaded?

No. Parsing and serialising are pure string operations running in your browser, with no network access of any kind. Spreadsheet exports are frequently full of customer names, email addresses and financial figures, which makes a client-side converter the appropriate choice rather than a nice extra.

Other recommended tools