Skip to the tool
ViewCSV
Files stay on your device

Convert CSV to JSON

orders.csv· SAMPLE DATA15 rows · 8 columns
Value types
Detection is per column and only when every value fits, so IDs with leading zeros and integers beyond 9,007,199,254,740,991 stay text.
Columns named user.name and user.email become one “user” object holding “name” and “email”.
[
  {
    "order_id": "001041",
    "customer": "Liam Garcia",
    "city": "Austin",
    "product": "Desk lamp",
    "quantity": "6",
    "unit_price": "142.72",
    "order_date": "2026-01-09",
    "status": "paid"
  },
  {
    "order_id": "001042",
    "customer": "Mary Clark",
    "city": "Seattle",
    "product": "Monitor 27\"",
    "quantity": "5",
    "unit_price": "210.76",
    "order_date": "2026-02-03",
    "status": "shipped"
  },
  {
    "order_id": "001043",
    "customer": "Henry Taylor",
    "city": "Denver",
    "product": "Notebook A5",
    "quantity": "1",
    "unit_price": "143.74",
    "order_date": "2026-03-25",
    "status": "pending"
  },
  {
    "order_id": "001044",
    "customer": "Lucas Smith",
    "city": "Chicago",
    "product": "Monitor 27\"",
    "quantity": "5",
    "unit_price": "137.00",
    "order_date": "2026-04-25",
    "status": "shipped"
  },
  {
    "order_id": "001045",
    "customer": "Noah Davis",
    "city": "Seattle",
    "product": "USB-C cable",
    "quantity": "7",
    "unit_price": "",
    "order_date": "2026-05-11",
    "status": "refunded"
  },
  {
    "order_id": "001046",
    "customer": "Emma Williams",
    "city": "Portland",
    "product": "Notebook A5",
    "quantity": "6",
    "unit_price": "166.44",
    "order_date": "2026-06-10",
    "status": "pending"
  },
  {
    "order_id": "001047",
    "customer": " Henry Taylor ",
    "city": "New York",
    "product": "Monitor 27\"",
    "quantity": "7",
    "unit_price": "57.53",
    "order_date": "2026-07-14",
    "status": "pending"
  },
  {
    "order_id": "001048",
    "customer": "Lucas Jones",
    "city": "Austin",
    "product": "Desk lamp",
    "quantity": "7",
    "unit_price": "194.19",
    "order_date": "2026-08-03",
    "status": "pending"
  },
  {
    "order_id": "001049",
    "customer": "Olivia Williams",
    "city": "Austin",
    "product": "USB-C cable",
    "quantity": "5",
    "unit_price": "190.03",
    "order_date": "2026-09-07",
    "status": "pending"
  },
  {
    "order_id": "001050",
    "customer": "Mary Wilson",
    "city": "New York",
    "product": "Chair, ergonomic",
    "quantity": "8",
    "unit_price": "61.04",
    "order_date": "2026-01-15",
    "status": "pending"
  },
  {
    "order_id": "001051",
    "customer": "Noah Williams",
    "city": "Portland",
    "product": "Chair, ergonomic",
    "quantity": "2",
    "unit_price": "61.37",
    "order_date": "2026-02-25",
    "status": "refunded"
  },
  {
    "order_id": "001052",
    "customer": "Mia Smith",
    "city": "Boston",
    "product": "Monitor 27\"",
    "quantity": "5",
    "unit_price": "231.42",
    "order_date": "2026-03-09",
    "status": "refunded"
  },
  {
    "order_id": "001053",
    "customer": "Ava Garcia",
    "city": "Boston",
    "product": "USB-C cable",
    "quantity": "3",
    "unit_price": "201.24",
    "order_date": "2026-04-05",
    "status": "pending"
  },
  {
    "order_id": "001054",
    "customer": "Mary Clark",
    "city": "Boston",
    "product": "Desk lamp",
    "quantity": "5",
    "unit_price": "35.49",
    "order_date": "2026-05-12",
    "status": "pending"
  },
  {
    "order_id": "001043",
    "customer": "Henry Taylor",
    "city": "Denver",
    "product": "Notebook A5",
    "quantity": "1",
    "unit_price": "143.74",
    "order_date": "2026-03-25",
    "status": "pending"
  }
]

15 rows · 1 file

Open or paste a CSV file and the JSON appears next to the options as you change them. By default each row becomes an object keyed by the column names; choose an array of arrays, an object of column arrays or JSON Lines when the receiving code expects that shape. Every value stays a string by default, so 00731 and 20-digit IDs come out exactly as they were; turn on number detection only when a column should become JSON numbers and true/false. For configuration files, CSV to YAML writes the same rows as YAML. The file is converted in your browser and never uploaded.

How to convert CSV to JSON

  1. Open a .csv, .tsv or .txt file, drop it on the tool, or paste rows. The delimiter and a UTF-8 or UTF-16 byte-order mark are detected; pick another delimiter or a legacy encoding such as Windows-1252 or Shift_JIS under Import settings.
  2. Choose the JSON shape. The preview shows the first 200 rows of the exact output the download will contain.
  3. Set Value types, Empty cells, nesting and indentation, then select Download JSON or Copy.

To convert many files with the same settings, choose Batch and select them together: each file is converted in turn and the results download as one ZIP.

JSON output options: objects, arrays or JSON Lines

Array of objectsOne object per row, keyed by the header: [{"sku": "00731", …}]. The shape most APIs and JavaScript code expect.
Array of arraysThe header row first, then each row as a list. Smallest output; column order is kept explicitly.
Object of column arrays{"sku": ["00731", "00732"], …} — convenient for charting libraries and data-frame tools.
JSON LinesOne JSON object per line (JSON Lines), with no surrounding array. Suits log pipelines, BigQuery loads and line-by-line processing.
Keep every value as textEvery cell becomes a JSON string, exactly as written in the file. This is the default.
Detect numbers and true/falseA column becomes JSON numbers only if every non-empty value is a plain number that survives the conversion: no leading zeros, at most 15 significant digits, no decimal comma. true/false columns become booleans. Dates stay strings.
Empty cellsWrite "", null, or leave the key out of that object.
Nest dotted column namesuser.name and user.email become {"user": {"name": …, "email": …}}. If a name is both a value and a parent (user and user.name), those columns stay flat and the tool tells you.

Headers, quoted values and IDs in the JSON

  • Quoted commas, quotes ("") and line breaks inside a value are read per RFC 4180 and written as ordinary JSON string escapes (\n, \").
  • Header names are used exactly as written, including spaces and non-Latin scripts. A blank header becomes Column 3; a repeated one becomes name (2), so no value is overwritten.
  • Headers such as __proto__ or constructor are written as ordinary keys.
  • A row with more values than the header gets extra keys named Column 4, Column 5…; a shorter row gets empty values. Nothing is dropped.
  • Typed output never turns 0012 into 12 or a 19-digit order number into a rounded float: such a column stays text.

Common CSV to JSON problems

  • Everything is in one key. The delimiter was guessed wrong; set Comma, Semicolon, Tab or Pipe under Import settings and open the file again.
  • Accented letters look like é. The file is not UTF-8. Choose its encoding (often Windows-1252 for older Excel exports) under Import settings.
  • A number column stayed text. At least one value isn’t a plain number — for example 1,5, 12 kg or a value with a leading zero. Search the column in the CSV viewer to find it.
  • The quoting error names a record. A quote opened in that record never closes. Fix it in the CSV editor or check the source system’s export.

Limits and privacy

Files up to 25 MB, 100,000 rows or 2 million cells open with a live preview. Larger files are converted in streaming mode: the file is read twice in chunks (once to learn the columns and types, once to write), the preview is replaced by a notice, and the download covers every row. A single output file is capped at 4 GB.

Conversion runs in a background worker in this tab, so the page stays responsive and Cancel stops it. The CSV is never sent to a server.

Example: a product list as JSON objects

A product list with a leading-zero SKU and a quoted comma, converted with the default settings (all text, array of objects, 2-space indent). With Detect numbers and true/false, price becomes 34.9 and in_stock becomes true, while sku stays "00731".

CSV
sku,name,price,in_stock
00731,"Desk lamp, brass",34.90,true
00732,Cable tidy,4.50,false
JSON
[
  {
    "sku": "00731",
    "name": "Desk lamp, brass",
    "price": "34.90",
    "in_stock": "true"
  },
  {
    "sku": "00732",
    "name": "Cable tidy",
    "price": "4.50",
    "in_stock": "false"
  }
]

Questions and answers

Why are numbers in quotes by default?

Because CSV has no types: 00731, 1.50 and 2024-03-01 are all just text. Keeping them as strings guarantees the JSON says exactly what the file said. Choose number detection when you know a column holds quantities.

Can I convert JSON back to CSV here?

Not yet. This page converts CSV and TSV into JSON only.

Is JSON Lines the same as NDJSON?

Yes, in practice: both mean one complete JSON value per line, separated by newline characters.

Standards and references