📊

CSV / JSON Converter

Transform CSV data to JSON arrays and vice versa. Choose delimiters, preview in a table, and download results. All processing is local.

Updated July 11, 2026

100% Private & Secure

This tool runs in your browser.
Your data is never uploaded or stored.

Input CSV (Comma)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Output JSON

JSON output will appear here...

How to use

  1. 1

    Paste CSV or JSON data into the input.

  2. 2

    Choose the conversion direction and delimiter.

  3. 3

    Preview the result and copy or download.

When to use it

Loading spreadsheet exports into an app

Most accounting tools, CRMs, and databases export tabular data as CSV. Converting it to a JSON array of row objects lets your JavaScript or Python code iterate records by field name instead of splitting on commas and indexing into positional arrays.

Seeding a database or API fixture

Hand-editing large JSON seed files is error-prone. Maintain the source of truth in a spreadsheet, export to CSV, and convert it to JSON objects that drop straight into a migration script or a POST /import endpoint.

Producing a human-readable data preview

A CSV dump from a nightly job is hard to scan visually. Rendering it as structured JSON (or a table preview) makes the row-to-field mapping obvious during debugging.

"name,age\nAda,36\nLin,41" -> [ { "name": "Ada", "age": "36" }, { "name": "Lin", "age": "41" } ]

Flattening nested JSON for a spreadsheet

Analysts live in spreadsheets. Converting a flat JSON array back to CSV gives them a file they can open in Excel or Google Sheets without writing a script.

How it works

How RFC 4180 defines CSV

CSV has no single universal standard, but RFC 4180 (October 2005, "Common Format and MIME Type for Comma-Separated Values (CSV) Files") is the de facto baseline. It registers the text/csv MIME type and pins down three rules that naive split-on-comma parsers get wrong:

Fields containing a comma, a double quote, or a line break must be wrapped in double quotes. Inside a quoted field, a literal double quote is escaped by doubling it — "". Records are separated by CRLF, and a header row is conventional but not mandatory. RFC 4180 also declares fields as text — there is no native type information, so the number 41 and the string "41" are indistinguishable until a converter applies a type.

  • Quoted field: "Smith, John" — one field, not two
  • Escaped quote: "He said ""hi""" — value is He said "hi"
  • Embedded newline: a quoted field may legally span multiple physical lines

Why the CSV-to-JSON mapping is not lossless

CSV is a flat table of rows and columns; JSON is a tree that can nest arbitrarily deep. Converting CSV to JSON therefore forces a representational choice. The common convention — treating the header row as object keys and each data row as values — produces a flat array of flat objects. That works for a product list, but it cannot round-trip nested structures like { "address": { "city": "Berlin" } } without a schema or dot-notation convention such as address.city.

The reverse direction loses even more. A JSON document with mixed-shape array elements, nested objects, or varying keys cannot be squared into a uniform column grid. When you convert JSON to CSV, decide which fields to project and how to flatten nesting before you click convert.

# Flat CSV round-trips cleanly:
name,age
Ada,36            ->  [{ "name": "Ada", "age": "36" }]

# Nested JSON does NOT map to CSV without a flatten rule:
[{ "user": { "name": "Ada" } }]   ->   needs user.name projection

Delimiters and encoding pitfalls

Comma is the RFC 4180 default, but regional Excel installs in much of Europe use semicolon as the list separator and emit name;age. Tab-separated values (TSV) use \t. A converter that only splits on commas will silently mangle semicolon-delimited European files — always confirm the delimiter against the source before parsing.

Encoding matters too. RFC 4180 allows any character set, but UTF-8 is the only safe choice for data crossing systems. Watch for a leading byte-order mark (BOM, U+FEFF): it is invisible in editors but appears as a stray character on the first header key ("\uFEFFname"), which then fails to match the expected "name" field.

Common mistakes & edge cases

Problem

A comma inside a field splits it into two columns

Fix

The field must be quoted per RFC 4180: write "Smith, John" as a single quoted value. A naive split(",") is wrong — use a spec-aware CSV parser.

Problem

Double-quote characters break the field

Fix

Escape each literal " by doubling it: "He said ""hi""". Inside a quoted field, "" is the RFC 4180 escape sequence for a single ".

Problem

Numbers come through as strings

Fix

CSV has no types — every cell is text. Apply type coercion (Number(), parseInt, or a schema) after conversion if your downstream code expects numeric values.

Problem

European files parse as a single column

Fix

Those files usually use a semicolon separator. Switch the delimiter from comma to semicolon (or auto-detect) before converting.

Frequently Asked Questions

What delimiters are supported?
Comma, semicolon and tab.
Does the first row need to be a header?
Yes. The first row is used as field names for JSON objects.

References & further reading

Related reading

Related Tools

View all tools