CSV to JSON Converter

Convert CSV data to JSON format instantly

Free
CSV Input
JSON Output
Formatted JSON will appear here...

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

CSV in
name,age,city
John,25,Lahore
Sara,30,Karachi
JSON out
[
  {
    "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

CSV in
sku,price,notes
A-100,19.99,clearance
A-101,24.50
JSON out
[
  { "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

CSV in
A-100,19.99
A-101,24.50
Result
Error: CSV must have a header row
and at least one data row

Without 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. 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. 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. 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. 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. 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

OptionBest forTrade-off
This browser converterA few dozen to a few thousand clean rows you already have in the clipboardNo quoted-comma handling, no type inference, and everything runs in one tab — so very large files are impractical.
A parsing library in codeRecurring imports, messy quoting, and files too large for a browserRequires a runtime and a script, but handles RFC 4180 quoting, streaming and custom type coercion properly.
Spreadsheet formulas or add-onsOne-off conversions for non-developersFragile with nested structures and easy to break when the sheet changes shape.
The destination system’s own importerCRMs, ecommerce platforms and databases with a CSV import screenSkips 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: .

Works great with these tools

After converting your CSV, beautify and validate the JSON output with our free JSON formatter and validator.

Need to send the JSON over an API that only accepts text? Encode it in Base64 with our free encoder.

Checking the content of a text column in your CSV? Paste cell values into our free word counter to check length.

CSV to JSON Converter: frequently asked questions

Answers to the questions people ask most often about this specific tool.

What shape of JSON does this produce?

An array with one object per data row. Keys are taken verbatim from the header row, and every value is emitted as a string because CSV carries no type information.

Do I need a header row?

Yes. Without one there are no key names, and the converter returns an error. The names you use in the header become your JSON property names, so match them to what the destination system expects.

What happens to commas inside quoted fields?

They are treated as separators, which shifts the later columns in that row. If your data contains commas inside values, export with a different delimiter or split those columns before converting.

Why are my numbers strings in the output?

CSV has no way to declare a column as numeric, so everything is emitted as a string. Cast values in your import script or in the destination schema, where you can decide whether a blank cell becomes null or zero.

Why does my first column key not match?

Files exported from Excel often begin with an invisible byte-order mark that attaches to the first header name. Save as CSV UTF-8 without BOM, or remove the first character.

What happens if a row has fewer values than the header?

Missing keys are filled with empty strings rather than being dropped, so every object keeps the same shape — which is usually what a bulk importer expects.

Is my spreadsheet data uploaded?

No. Conversion runs entirely in your browser. Even so, treat any browser tab as an unsuitable place for regulated personal data.

Picked from Developer Tools and adjacent categories. Each one has its own page explaining how it works and where it falls short.

Looking for something else? Browse all 27 free tools →