Convert CSV to JSON!

Input CSV to convert it into a JSON array keyed by the first row! Tables copied from Excel or Google Sheets work too.
CSV
Result
 

Convert CSV to JSON!

Give it CSV text and it builds a JSON array with one object per row, using the first line as keys. Copying a cell range from Excel or Google Sheets produces tab-separated text; since the delimiter is detected automatically, you can paste it straight in without saving a file first.

Typical use is moving a product list or translation table that lives in a spreadsheet into seed data, mock responses or test fixtures.

How to use

  1. Copy the range from your sheet, header row included, and paste it into the CSV box. Dropping a .csv file onto the input also loads its contents.
  2. Leave Convert numbers and booleans on to turn values like 35 and true into JSON numbers and booleans; switch it off to keep every value as a string.
  3. Copy the resulting JSON. The checkbox state is stored in the URL (?types=0), so a bookmark keeps it.

Example

Input (TSV (Excel / Google Sheets))
sku	name	price	zip	active
A-01	USB-C cable	9.9	04524	true
A-02	Charger 65W	35	01000	false
Output (JSON)
[
  {
    "sku": "A-01",
    "name": "USB-C cable",
    "price": 9.9,
    "zip": "04524",
    "active": true
  },
  {
    "sku": "A-02",
    "name": "Charger 65W",
    "price": 35,
    "zip": "01000",
    "active": false
  }
]

This is tab-separated text copied from a sheet. price became a number and active a boolean, while 04524 keeps its leading zero as a string so the postal code survives.

Supported features

  • Delimiter detection: whichever of comma, tab or semicolon appears most often outside quotes on the first line.
  • RFC 4180 quoting: delimiters and line breaks inside quoted values such as "Busan, Korea", and quotes escaped as "", are read correctly.
  • Conservative typing: numbers with leading zeros (007), exponent notation (1e3) and integers beyond JavaScript's safe range stay strings.
  • Only lowercase true, false and null become booleans and null.
  • Blank headers become column2 and so on, duplicates become name_2, and rows wider than the header get extra columnN keys.
  • Both CRLF and LF line endings work, and blank lines are skipped.

Use cases

Turning a planner's spreadsheet into seed data

Categories, pricing plans or FAQ entries maintained in a sheet can become a JSON array for a seed script or a fixtures/*.json file.

Mock responses for front-end work

Before the backend exists, jot a few sample rows in a sheet and convert them into a response body for MSW or json-server.

Moving query results into code

Copy a result grid from DBeaver or DataGrip as CSV, convert it, and paste the array into a test as the expected value.

Notes and limitations

  • Output is always a flat array of objects; a header such as user.name is not turned into a nested object.
  • TRUE, Yes and empty cells are not converted; an empty cell becomes an empty string "".
  • You cannot choose the delimiter manually. If the first line mixes commas and tabs outside quotes, the more frequent one wins, so check the resulting keys.
  • The first line is always treated as the header. For headerless CSV, add a line of names before pasting.

FAQ

Why did my numeric ID come out as a string?

Values like 0012, or integers above 9007199254740991, would change if parsed as numbers, so they are deliberately kept as strings. If you really need a number, convert it in your code where you control the precision.

Does semicolon-separated CSV work?

Yes. The a;b;c format that Excel writes in European locales is detected from the first line. Decimal commas such as 1,5 then stay strings rather than numbers.

What about cells that contain line breaks?

If the value is wrapped in double quotes, the line break is kept inside it as \n. Excel adds those quotes automatically when you copy a cell edited with Alt+Enter, so pasting works as is.