Convert

Result

Turns a CSV table into JSON indented by two spaces: an array of objects, one object per data row, with the header cells as keys.

About this tool

A spreadsheet stores a header and rows. JSON stores an array of objects with named keys. This page reads the CSV you already have and writes that array, so the rows can go to an API that expects objects.

name,city followed by Ada,Ankara and Lin,Lyon becomes two objects. The keys are name and city. Both values are strings, so Ankara is "Ankara" and a cell that looks like a number is still quoted text.

The tool does not invent types, fill empty header cells, or keep rows that are entirely empty. The output is an array of objects, indented by two spaces. If the page refuses the file, fix the header or add a data row.

How to use it

  1. 1

    Drop a CSV file or paste the text. The sample button inserts a short example. The first row must be a header, and every header cell must contain text.

  2. 2

    Each data row becomes one object. The number 12 in a cell becomes the string "12". The tool does not guess types.

  3. 3

    A header-only file is rejected. Rows whose cells are all empty are dropped. A leading UTF-8 BOM is stripped before the header is read.

What it accepts

The file is UTF-8 CSV. The first row is the header, and no header cell may be empty. At least one data row is required. Example: name,city then Ada,Ankara then Lin,Lyon becomes [{"name":"Ada","city":"Ankara"},{"name":"Lin","city":"Lyon"}] with a two-space indent. A comma inside quotes stays in one field. A doubled quote inside a quoted field becomes one quote. Every value is a string, including numbers. Rows whose cells are all empty are omitted.

Where your data stays

The CSV you open and the JSON array written from it stay on this machine. MegaToolkit does not receive the table. A chosen file larger than 2 MB is not read. The page lets you copy the JSON or download the converted text. Closing the tab drops both.

Questions

Why is 12 a string in the JSON?

Every cell is kept as text. The sheet value 12 becomes "12". The tool does not guess that a cell is a number, a boolean, or a date.

What if a field contains a comma?

A comma inside quotes stays in that field. A doubled quote inside a quoted field becomes a single quote in the JSON string. The row is not split on that comma.

Why was a header-only file rejected?

The header names the keys, and at least one data row is required. A file that stops after the header is refused. Add a row of values and try again.

Does the CSV leave this browser?

No. Parsing and the JSON result stay here. Nothing from this table is uploaded to MegaToolkit. Closing the tab drops the text.