From rows and columns to objects and arrays
A CSV to JSON converter reads a header row, then turns each following line into a JSON object whose keys come from that header — producing an array of objects that APIs, scripts and NoSQL stores can consume directly.
Spreadsheets are where business data lives; JSON is what APIs and application code want. The gap between them is crossed constantly — seeding a test database, bulk-importing products, sending a client’s contact list into a CRM, or turning an analytics export into fixtures for a unit test.
The conversion looks trivial and mostly is, but CSV is a far looser format than its reputation suggests. This page shows exactly what shape you get out, documents this converter’s parsing limits honestly, and explains which quirks you should fix in the source file before converting.
The exact output shape
Direct answer: you get a JSON array, one object per data row, with keys taken verbatim from the header row and every value emitted as a string.
Example 1: A straightforward table
name,age,city
John,25,Lahore
Sara,30,Karachi[
{
"name": "John",
"age": "25",
"city": "Lahore"
},
{
"name": "Sara",
"age": "30",
"city": "Karachi"
}
]Note that "25" is a string, not a number. CSV carries no type information, so nothing in the file says whether a column is numeric. Cast in your code, or in the destination schema.
Example 2: Missing cells and short rows
sku,price,notes
A-100,19.99,clearance
A-101,24.50[
{ "sku": "A-100", "price": "19.99", "notes": "clearance" },
{ "sku": "A-101", "price": "24.50", "notes": "" }
]A row shorter than the header gets empty strings for the missing keys rather than null or a dropped property. Every object keeps the same shape, which is usually what an importer expects.
Example 3: Header row is mandatory
A-100,19.99
A-101,24.50Error: CSV must have a header row
and at least one data rowWithout a header there are no key names. Add one line naming the columns — the keys you type there become your JSON property names, so use the names your target system expects.
Parsing limits to know before you paste
This converter uses a straightforward line-and-comma split. That handles the overwhelming majority of exports, but there are specific shapes it will get wrong — better that you know them than discover them in production.
Commas inside quoted fields are not preserved
A field such as "Lahore, Punjab" is split at the comma, shifting every later column in that row. If your data contains commas inside values, re-export the sheet using semicolons or tabs as the delimiter and replace them afterwards, or split those columns before converting.
Newlines inside a cell break the row
A multi-line address or a comment field with a line break becomes two rows. Find and remove embedded newlines in the spreadsheet before exporting.
Only surrounding quotes are stripped
A leading and trailing double quote is removed from each header and value. Escaped inner quotes ("" in the CSV spec) are left as they are, so tidy those in the source if they matter.
Duplicate header names collide
Two columns called "email" produce one key, and the rightmost column wins because later assignments overwrite earlier ones. Rename columns to be unique before converting.
A leading UTF-8 byte-order mark
Files exported from Excel often begin with an invisible BOM, which attaches to the first header name and produces a key that looks correct but does not match. If your first field is mysteriously unreachable, this is why — save as "CSV UTF-8" without BOM, or delete the first character.
Excel reformats values on export
Long numeric IDs become scientific notation, leading zeros disappear from postcodes, and dates are localised. Format those columns as Text in the spreadsheet before exporting; no converter can recover data the export already destroyed.
A conversion that survives contact with real data
- 1
Clean the sheet first
Remove merged cells, blank separator rows and totals rows. Make sure the header row is the first row and that every column has a unique, code-friendly name.
- 2
Export as CSV, then check the delimiter
Some locales export with semicolons by default. Open the file in a plain text editor and confirm the separator before pasting.
- 3
Convert and read the tree
The output panel renders as a collapsible tree with types colour-coded, so a shifted column is visible as soon as values land under the wrong key.
- 4
Cast types downstream
Everything arrives as a string. Convert numbers, booleans and dates in your import script or in the database schema — deliberately, so a blank cell becomes null rather than 0.
- 5
Validate the final payload
Paste the result into the JSON formatter to confirm it parses cleanly before sending it to an API or committing it as a fixture.
This converter vs. a script vs. a spreadsheet formula
| Option | Best for | Trade-off |
|---|---|---|
| This browser converter | A few dozen to a few thousand clean rows you already have in the clipboard | No quoted-comma handling, no type inference, and everything runs in one tab — so very large files are impractical. |
| A parsing library in code | Recurring imports, messy quoting, and files too large for a browser | Requires a runtime and a script, but handles RFC 4180 quoting, streaming and custom type coercion properly. |
| Spreadsheet formulas or add-ons | One-off conversions for non-developers | Fragile with nested structures and easy to break when the sheet changes shape. |
| The destination system’s own importer | CRMs, ecommerce platforms and databases with a CSV import screen | Skips JSON entirely and enforces the target schema — often the right answer when one exists. |
Conversion happens entirely in your browser, so customer lists and export files are not uploaded anywhere. Even so, treat any browser tab as an untrusted place for regulated personal data.
How this page is maintained
The output shape, the header requirement, the empty-string behaviour for short rows and the quote-stripping rule described here were read directly from this converter’s code. The quoted-comma and embedded-newline limitations are documented rather than hidden, so you can decide whether this tool fits your file.
Written and reviewed by the ToolsRacks editorial team. Last reviewed: .