CSV to JSON Converter – Turn CSV into Valid JSON Instantly

Paste CSV data and convert it to clean JSON with header row detection, custom delimiters, type inference, and pretty printing. Choose between an array of objects or an array of arrays. No signup, no uploads — everything runs in your browser.

Configure

Set up your conversion
Pro tip: If your first row contains column names, leave First row is header checked. The converter will use them as JSON object keys.
Input delimiter
Output format

JSON Output

Results

Your JSON will appear here

Paste some CSV, choose a delimiter, then click Convert to JSON.

What does the CSV to JSON converter do?

This free online tool takes comma-separated (or tab, semicolon, pipe, or custom-delimited) CSV data and turns it into well-formed JSON. With header detection on, the first row of your CSV becomes the keys and every following row becomes a JSON object. With header detection off (or Arrays mode), you get a nested array of arrays instead.

Unlike a naive string-replace, this converter handles the messy parts of real CSV: quoted fields containing commas, escaped double quotes, CRLF line endings, blank rows, and mixed numeric/string data. When type inference is on, values like 42, true, and empty cells become native JSON numbers, booleans, and nulls instead of strings.

Everything runs locally in your browser. Your data never leaves your device — no server upload, no logging, no tracking. Close the tab and it's gone.

How to convert CSV to JSON — step by step

  1. Paste your CSV: Drop comma, tab, semicolon, pipe, or space-separated rows into the input box above.
  2. Pick the input delimiter: Auto-detect works for most CSVs. If your data uses semicolons or tabs, pick them manually.
  3. Choose the output format: Objects uses your header row as keys (recommended when your CSV has headers). Arrays produces nested arrays with no keys.
  4. Set the toggles: Enable or disable header detection, type inference, pretty printing, whitespace trimming, and blank-line skipping.
  5. Click Convert to JSON: The output appears instantly, with record and key counts.
  6. Copy or download: Use the Copy JSON button or download the result as a .json file ready for APIs, MongoDB, config files, or anything else.

Shortcut: Press Ctrl + Enter (or Cmd + Enter on Mac) inside the input box to convert instantly.

Example: before and after

Input (CSV with header row)

Name,Age,City,Active
Alice,30,New York,true
Bob,25,London,false

Output (Array of objects, type inference on)

[
  {
    "Name": "Alice",
    "Age": 30,
    "City": "New York",
    "Active": true
  },
  {
    "Name": "Bob",
    "Age": 25,
    "City": "London",
    "Active": false
  }
]

Same input as Array of arrays (no keys)

[
  ["Alice", 30, "New York", true],
  ["Bob", 25, "London", false]
]

Notice that 30 and true are stored as native JSON types, not strings — that's type inference at work. Disable it if your downstream system expects everything as a string.

When would you need to convert CSV to JSON?

API payloads

Build JSON request bodies for REST APIs from spreadsheet data. Convert a product catalog or user list into JSON your backend expects.

Database imports

MongoDB, Firebase, and CouchDB all import JSON natively. Convert CSV exports into import-ready JSON documents.

Static config files

Turn a spreadsheet of feature flags, translations, or SEO metadata into a JSON file your app can read at build time.

Data analysis

Convert CSV into JSON for Python, JavaScript, or R scripts that expect structured objects with named keys rather than positional arrays.

NoSQL seeding

Seed a Firestore, MongoDB, or DynamoDB collection from CSV test data by converting to JSON first.

Quick prototyping

Mock an API response by converting sample CSV into JSON you can paste into a mock server or inline in code.

Type inference reference

When Infer types is enabled, each cell is examined and converted from string to its best-fit JSON type. Here's what the converter does:

Input value JSON type Output
42number42
3.14number3.14
-7number-7
true / falsebooleantrue / false
(empty)nullnull
007string"007" (leading zero preserved)
hellostring"hello"
1,234string"1,234" (comma breaks number parsing)

If you need everything as a string (for example, a system that rejects numbers), just turn type inference off.

Tips and best practices

  • Check your header row. If your CSV has a header, leave First row is header on. If it doesn't, either turn it off or the first row of data will be silently used as keys.
  • Use Arrays mode when keys would be misleading. If your CSV has no header and you don't want to invent column names, Arrays output is the honest choice.
  • Watch out for duplicate column names. Two columns named the same in Objects mode will overwrite each other — the last value wins. Rename them in the CSV first.
  • Leading zeros matter. Postal codes and phone numbers like 007 or 0800 are kept as strings by default so Excel-style number coercion doesn't strip the zeros.
  • Pretty print for humans, compact for machines. Turn pretty print off when you're embedding the JSON in a URL, a script, or a storage system where size matters.
  • Need the reverse? Try the JSON to CSV tool to go the other way.
  • Need to clean up the CSV first? Run it through the Whitespace Cleaner or Remove Empty Lines tool.

Related tools you might need

Privacy, accuracy, and limits

Privacy: Nothing you paste into this converter is sent to a server. The whole CSV parser and JSON generator is JavaScript running in your browser tab. There is no upload, no analytics event containing your data, and no server-side log.

Accuracy: The parser follows RFC 4180, so quoted fields with commas, newlines, and escaped quotes are handled correctly. Type inference covers the common cases (numbers, booleans, nulls) and preserves strings that would be ambiguous — like 007 or 1,234. Auto-detect picks the delimiter that appears most consistently across the first few lines.

Limits: There is no hard limit on input size. Since everything runs in-browser, the practical limit is your device's memory. A CSV with tens of thousands of rows converts in well under a second. Very large pastes (multiple megabytes) may take a moment.

Frequently asked questions

It takes CSV data, parses it (including quoted fields with commas or newlines inside), and produces valid JSON. With header detection on, the first row becomes the object keys and each subsequent row becomes a JSON object. Without headers, it outputs an array of arrays.
Yes. The parser follows RFC 4180, so fields wrapped in double quotes can safely contain commas, semicolons, newlines, and escaped double quotes.
When enabled, the converter detects numbers, booleans, and null values and stores them as their native JSON types instead of strings. For example, 42 becomes a number, true becomes a boolean, and an empty value becomes null.
Yes. Use the Output format selector. Array of objects uses the header row as keys. Array of arrays produces nested arrays with no keys, which is useful when you don't have a header.
Yes. Everything runs in your browser using JavaScript. Your CSV data never leaves your device. There is no server upload, no logging, and no data storage.
Yes. Click the download button to save the output as a .json file. It works with any tool that consumes JSON — APIs, MongoDB import, config files, and more.
Yes, completely free. No signup, no watermark, no hidden charges.
Yes. Once the page loads, the converter works without an internet connection.
Duplicate keys would overwrite each other in JSON. The tool keeps the last value. If duplicates are a possibility, rename the columns in your CSV before converting, or use Array of arrays output.
Absolutely. Pick Semicolon or Tab from the input delimiter options, or use Auto-detect which guesses based on the first row.