CSV to JSON Converter

Paste CSV data and get pretty-printed JSON — supports delimiters, header toggle, and value trimming

Input & Settings

Try a sample:

JSON Output

Output appears here

Paste CSV above or pick a sample

Examples

CSV with headers → array of objects

name,age,city
Alice,30,New York
Bob,25,Boston

// Output:
[
  { "name": "Alice", "age": "30", "city": "New York" },
  { "name": "Bob",   "age": "25", "city": "Boston"  }
]

With the 'First row is header' toggle on, each subsequent row maps to a JSON object whose keys come from the header row.

Headerless CSV → array of arrays

Alice,30,New York
Bob,25,Boston

// Output:
[
  ["Alice", "30", "New York"],
  ["Bob",   "25", "Boston"]
]

With headers disabled, every row becomes a plain array of strings, preserving the original column order.

Details

This tool uses the PapaParse library to reliably parse CSV text in your browser. When 'First row is header' is enabled, each data row becomes a JSON object keyed by the header names. When disabled, rows become plain arrays. Auto-delimiter detection picks the right separator automatically, or you can force comma, semicolon, or tab. The trim option strips leading and trailing whitespace from every value before serialisation. All processing happens locally — your data never leaves your browser.

    About this tool

    CSV (Comma-Separated Values) is the most widely used tabular data format for spreadsheets, databases, and data exports. JSON (JavaScript Object Notation) is the dominant format for APIs and modern web applications. Converting between the two is a daily task for developers, data analysts, and backend engineers.

    This tool uses PapaParse — the fastest and most reliable CSV parser for JavaScript — to handle edge cases like quoted fields containing commas, escaped characters, and mixed line endings. The result is always pretty-printed, valid JSON that you can paste directly into your code or API payload.

    All processing happens locally in your browser. No data is uploaded to any server, making the tool safe for confidential datasets, internal CSVs, and personally identifiable information.

    How to use

    1. Convert a CSV with headers

      Paste your CSV (or pick a sample chip), keep 'First row is header' on, then click Convert to JSON. Each data row becomes a JSON object keyed by the header values.

    2. Parse a headerless CSV as arrays

      Toggle 'First row is header' off before converting. Every row is output as a plain JSON array, useful when the CSV has no column names.

    3. Use a custom delimiter

      Open the Delimiter dropdown and choose Auto-detect, Comma, Semicolon, or Tab to match your file's separator.

    Output shape by mode

    ModeJSON output
    Header on[{"name":"Alice","age":"30"}] — array of objects keyed by header
    Header off[["Alice","30"]] — array of string arrays
    Trim onLeading/trailing whitespace removed from every value

    Frequently asked questions