IT Market
Tools/Code/Documents/CSV to JSON Converter Online — Array of Objects
CSV → JSON

Конвертируйте CSV таблицу в JSON массив

Tool guide

CSV to JSON Converter Online — Array of Objects

The data arrived as a spreadsheet but your code wants JSON: seed rows for a database, a mock for the front end, a request body, a lookup list for a form. This page reads the first CSV line as field names, turns every following line into an object and collects them into one array. Values stay as strings, so a product code with a leading zero is not silently reinterpreted as a number. The conversion runs in your tab. See also: take the objects back into a spreadsheet, check the resulting JSON for errors, tidy the source CSV before parsing it.

How to use it

  1. Paste the table into the «CSV Input» box; the first line must hold column names, as the name,age placeholder shows.
  2. Leave «Delimiter:» on «Detect automatically» — it is worked out from the first lines and named in the status line. Pick the semicolon by hand for an export from a European Excel.
  3. Press «Convert» (the convert button) and read the array in the «JSON Output» box.
  4. Inspect the first object: the keys should read as words, not as data from your first record.
  5. Press «Copy JSON» to put the result on the clipboard, or «Download JSON» to save it as a file.

FAQ

Why are my numbers quoted as strings in the JSON?

Because types are not guessed. In a spreadsheet "007" and "7" look different but are both text, and coercing everything to numbers would destroy product codes, phone numbers and postal codes with leading zeros. If you need real numbers, cast the fields you care about on your side — Number(row.qty) in JavaScript or int() when loading in Python.

What happens if my CSV has no header row?

The first line is used as the key names anyway, so you get objects keyed by "1" and "Alex" and you silently lose that first record. The easy fix is to add a header line before pasting: one comma-separated line of sensible field names makes the output usable by code.

How do I handle a comma inside a value?

Wrapping the value in double quotes is enough: parsing follows RFC 4180, so such a field is not split. A quoted value may hold commas and line breaks, and a quote inside it is doubled — "he said ""yes""". An unclosed quote does not corrupt the data silently: the conversion stops with an error message. A bare comma in an unquoted value will still break the row, so add the quotes in the source export.

Can I get a nested structure instead of a flat array?

No — the output is always flat: one table row becomes one object with no nesting. CSV is a two-dimensional format, and a column named user.address.city stays a key that merely contains dots. Build the nesting in your own code after the conversion, or hand-write the JSON.

Is the output ready to POST to an API?

As a request body, yes, provided the endpoint expects an array of objects and tolerates string values. Many APIs enforce numbers and booleans through a schema, so validate or cast before sending. Every object carries the same keys: a short row is padded with empty values, trailing extra fields are dropped, and an empty cell produces an empty string rather than null.

How many rows can the browser handle?

A few thousand rows convert with no perceptible delay; tens of thousands introduce a visible pause, because both the source and the result sit in text fields in full. For very large exports a five-line script on your own machine is the better tool — use this page for quick batches and format checks.

Where does the table I pasted end up?

It stays in the input field of your own tab. The page script does the parsing and array building, and the download button assembles the file locally, so nothing leaves the device — a customer list or an order export is safe to convert here. Reloading the page clears both fields.

Examples

Staff list for a database seed
Before: id,name,role 1,Alex,admin 2,Maria,editor
After: [{"id":"1","name":"Alex","role":"admin"},{"id":"2","name":"Maria","role":"editor"}]
A code with a leading zero
Before: sku,qty 007,12
After: [{"sku":"007","qty":"12"}] — the zero survives because values stay strings