Turn a spreadsheet table into an array of JSON objects keyed by the header row
The tool loads here. It needs JavaScript, because the work happens on your device.
Your files and your privacy
The table is converted inside this browser tab and the JSON is produced by your own
device. There is no upload endpoint, the page’s Content-Security-Policy limits connect-src
to this origin, and Clear data discards both the table and the generated JSON.
What this tool does
Convert a CSV table into JSON: one object per data row, keyed by the header names, written
as a top-level array. Blank header names become positional keys and repeated names are
suffixed rather than overwriting each other. The conversion runs the other way too.
Conversion turns each data row into one JSON object, using the header row for the keys,
and writes the table as a top-level array indented with two spaces. A blank header cell
becomes a positional key such as column_3, and a name that appears twice takes a numeric
suffix so the second column keeps its data instead of overwriting the first. Every value
is written as a string, because a CSV file carries no type information to convert from.
How to use it
Select Choose a CSV or JSON file and load your table, or paste the rows straight in.
Check that the first row really is the header: its names become the keys exactly as
written, spaces and capitals included.
Deal with any ragged-row warning first, because cells beyond the last header column have
no key and do not reach the JSON.
Select Download JSON, or Copy JSON to paste it elsewhere. Download CSV is there too, for
when you only wanted the table tidied.
Example use cases
Loading a spreadsheet of test fixtures into a script that expects an array of objects.
Turning an exported product or price list into a JSON file for a static site build.
Flattening a saved JSON API response into a table you can open in a spreadsheet.
Supported input and output
Accepts
CSV, TSV or plain text with a header row, up to 50 MB
JSON containing a top-level array of objects, for the reverse direction
Produces
JSON, a top-level array of objects with string values, two-space indented
CSV, UTF-8 with CRLF endings, when converting JSON to a table
What this tool will not do
Every value is written as a string. The number 42 becomes the text 42 and true becomes
the text true; there is no type inference and no option for it.
An empty cell becomes an empty string, never null, so code that supplies a default when
a value is null will not supply it here.
Cells beyond the header width have no key and are dropped. They are reported as ragged
rows on load, and that is the warning to act on.
The first row is always the header, so a headerless file donates its first record to the
key names.
The output is a flat array of flat objects: a header such as user.name stays a literal
key with a dot in it, and repeated names get _2 and _3.
Common mistakes
Feeding the output to code that expects numbers. Adding a string of digits concatenates
it or yields NaN rather than raising an error, so the bug surfaces far from the
conversion.
Expecting the formula-injection-safe option to apply here. It belongs to the CSV writer,
so a value beginning with an equals sign reaches the JSON unchanged and is a formula
again if that JSON is written back out as CSV.
Converting a file that reported ragged rows and assuming every cell arrived: the extra
cells show in the preview but never reach the JSON.
Assuming a duplicated header column overwrites the first. It is renamed, so the data
sits under a key nobody is reading.
Technical notes
The CSV parse runs in a Web Worker using a hand-written RFC 4180 state machine, so quoted
delimiters and newlines inside quoted fields are resolved before conversion begins. Keys
are computed once from the header and each row is mapped by position, so a missing cell
becomes an empty string rather than an absent key and every object carries the same key
set. The reverse direction builds the columns from the union of keys across all objects in
first-seen order.
Frequently asked questions
Are numbers converted to JSON numbers?
No. Every value is written as a string, because a CSV file has no type information and
guessing is how converters turn a product code such as 0012 into the number 12. Cast the
values in whatever reads the JSON.
What happens to a column with no header name?
It gets a key based on its column number, so a third column with a blank header becomes
column_3. The data is kept and only the name is invented, so rename the column first if
you want a real key.
Can I convert JSON back to CSV?
Yes. Load a .json file containing a top-level array of objects and it becomes a table.
The columns are the union of keys across every object in first-seen order, and a nested
value is written into the cell as JSON text.