Conversion Tools

CSV to JSON

This free CSV to JSON converter turns comma-separated text, pasted or uploaded as a .csv or .txt file, into a pretty-printed JSON array of objects, using the first row as the keys for every record. Values are trimmed, kept as strings, and the conversion runs entirely in your browser, so your data is never uploaded.

Runs in your browser. Your files and text never leave your device - nothing is uploaded.

Upload CSV file
Click or drag & drop · .csv, .txt

Convert CSV to JSON Online

The Tools Kit's free CSV to JSON converter turns comma-separated text into a JSON array of objects. The first row of your CSV supplies the keys, and every row after it becomes one object with those keys. Paste the data or upload a .csv file, click Convert to JSON, and copy the pretty-printed result into your code, a config file, or an API request.

The conversion runs entirely in your browser. Your CSV file is read locally and is never uploaded, so it is safe to use for customer lists, internal exports, or anything else you would rather not send to a third-party server.

How to Convert a CSV File to JSON

  1. 1

    Add your CSV

    Paste comma-separated text into the CSV Input box, or drop a .csv or .txt file onto the upload area above it. Keep the column names on the first line, because that row becomes the JSON keys.

  2. 2

    Convert to JSON

    Click Convert to JSON. An uploaded file converts automatically as soon as it loads. Each data row becomes one object keyed by the header names.

  3. 3

    Check the output

    Read the JSON Output panel, which shows a pretty-printed array of objects with 2-space indentation. Every value is a string, exactly as it appeared in the CSV.

  4. 4

    Copy or clear

    Use Copy JSON to put the result on your clipboard, or Clear to empty the input and output and start over with another CSV.

CSV to JSON Example: How Rows Become Objects

Here is the three-line CSV shown as the placeholder in the input box, and the exact JSON the tool produces from it:

name,age,city
Alice,30,NYC
Bob,25,LA
[
  {
    "name": "Alice",
    "age": "30",
    "city": "NYC"
  },
  {
    "name": "Bob",
    "age": "25",
    "city": "LA"
  }
]

Three things are worth noticing. The header line name,age,city does not become an object itself; it only names the fields. Each of the two data rows becomes one object, in the same order as the CSV. And the ages come out as "30" and "25", in quotes: CSV has no data types, so the converter keeps every value as a string rather than guessing which ones are numbers, dates, or booleans.

The output is a flat array of objects, which is the shape most JavaScript, Python, and API code expects from tabular data. If you want to re-indent or validate it afterwards, paste it into the JSON formatter; to go the other way and turn a JSON array back into a spreadsheet-ready file, use the JSON to CSV converter.

What the Converter Handles, and What It Does Not

This is a deliberately simple CSV parser that splits each line on commas. That covers the everyday exports most people convert, but it helps to know the exact rules before you paste a large file.

  • Whitespace and quotes are cleaned. Each key and value is trimmed, and a double quote at the start or end of a field is removed, so "NYC" becomes NYC.
  • Windows line endings work. The carriage return at the end of each CRLF line is trimmed away, so CSV saved on Windows converts cleanly.
  • Short rows are padded. If a row has fewer values than the header, the missing keys are set to an empty string.
  • Extra values are dropped. Values beyond the last header column are not included in the object.
  • Commas inside quotes are not supported. A field such as "Smith, John" is split at the comma and the rest of the row shifts one column to the right.
  • Commas only. Semicolon and tab-delimited files are read as one long column, and line breaks inside a quoted field start a new row.
  • Unique column names. If two header cells share a name, the later column overwrites the earlier one in each object.
  • No empty lines in the middle. A blank line between rows becomes an object whose values are all empty strings; leading and trailing blank lines are ignored.

If your export contains repeated rows, run it through remove duplicate lines first. To check what changed between two versions of an export before converting, compare them side by side with the text compare tool.

CSV vs JSON: Which Format Should You Use?

CSV is a flat, row-and-column format that every spreadsheet can open and that stays compact for large tables. It has no data types and no nesting, and quoting rules vary between programs. JSON is the native data format of the web: it labels every value with a key, supports nested objects and arrays, and can be loaded directly by JavaScript with JSON.parse and by almost every other language with a standard library.

A common workflow is to keep data in a spreadsheet, export it as CSV, and convert CSV to JSON when a web app, API, or test fixture needs it. If your data starts life in another structured format, the XML to JSON converter and the YAML to JSON converter produce the same kind of JSON from those sources, and the full set of format tools is on the conversion tools hub.

Common uses

  • Turning a spreadsheet export into a JSON array to seed a database or a mock API
  • Building test fixtures or sample data for a JavaScript or Python project
  • Converting a product, price, or contact list into JSON for a static site or config file
  • Inspecting how a CSV's columns map to key-value pairs before writing an import script
  • Drafting a JSON payload by laying the fields out as CSV first, then converting it

If the goal is a readable table for a README or documentation rather than JSON, the Markdown table generator turns the same comma-separated rows into a Markdown table instead.

CSV and JSON terms explained

TermWhat it means here
CSVComma-separated values: plain text where each line is a record and commas separate the fields
Header rowThe first line of the CSV; its field names become the keys of every JSON object
DelimiterThe character that separates fields. This tool splits on commas only
JSON arrayAn ordered list in square brackets; here it holds one object per CSV data row
JSON objectA set of "key": value pairs in curly braces; here, one row of your CSV
Pretty-printingFormatting JSON with line breaks and indentation (2 spaces here) so it is easy to read
String valueText in double quotes. Every value this tool outputs is a string, including numbers

Frequently Asked Questions

Reviewed by Raja Jahangir · Last reviewed: October 7, 2026

How do you convert CSV to JSON?

To convert CSV to JSON, paste or upload the CSV and it becomes an array of objects, with the first row used as keys for every following row. Values stay strings, conversion runs in your browser, and quoted fields containing commas are not supported because the parser splits on plain commas.

Sources and standards