Skip to main content
Developer Tools

CSV to JSON

Proper RFC 4180 parsing — quoted commas, escaped quotes and embedded newlines all survive.

Comma · 5 columns · 3 rows
Parsed table (first 4 rows)
idnameroleactivesalary
1Ada LovelaceEngineertrue95000
2Hopper, GraceAdmiraltrue120000
3Alan TuringResearcherfalse88000
JSON · 3 objects · 347 B
[
  {
    "id": 1,
    "name": "Ada Lovelace",
    "role": "Engineer",
    "active": true,
    "salary": 95000
  },
  {
    "id": 2,
    "name": "Hopper, Grace",
    "role": "Admiral",
    "active": true,
    "salary": 120000
  },
  {
    "id": 3,
    "name": "Alan Turing",
    "role": "Researcher",
    "active": false,
    "salary": 88000
  }
]

How to Use

  1. 1. Paste your CSV, or drop a .csv or .tsv file onto the page.
  2. 2. Confirm the detected delimiter and whether the first row is a header.
  3. 3. Choose whether to convert numbers and booleans to real JSON types.
  4. 4. Copy or download the JSON.

Why CSV Is Harder Than It Looks

CSV looks like the simplest format in computing and is one of the fiddliest to parse correctly. A field may be quoted, and a quoted field may contain the delimiter, a doubled quote standing in for a literal quote, or even a line break in the middle of a value. Splitting on commas breaks on all three, which is why so many quick scripts turn "Hopper, Grace" into two columns and silently shift every field after it.

The delimiter itself is not fixed either. Much of Europe uses semicolons because the comma is the decimal separator, and exports from analytics tools often use tabs. Detection here counts each candidate only outside quoted regions — counting naively would pick the wrong character on any file with commas inside its text fields.

Type conversion is where a converter can quietly destroy data. Turning 42 into a number is helpful; turning the ID 007 into 7 or the phone number +441234 into 441234 loses information you cannot recover. This tool converts only fields that are numeric in their entirety and have no leading zero, so identifiers survive intact.

Two other traps are handled quietly: a UTF-8 byte-order mark, which otherwise becomes part of your first column's name and breaks every lookup against it, and duplicate column headers, which would silently overwrite each other and are instead numbered.

Related: JSON to CSV, JSON Formatter, and JSON Schema Generator.

Frequently Asked Questions

Why not just split the file on commas?

Because real CSV contains commas inside quoted fields, doubled quotes as escapes, and even newlines inside a single field. Splitting on commas mangles all three. This parser follows RFC 4180, so "Hopper, Grace" stays one value instead of becoming two.

What does type coercion do?

It turns numeric and boolean-looking text into real JSON types, so 42 becomes a number rather than "42". Values that only look numeric are deliberately left alone — an ID like 007 and a phone number like +441234 stay strings, because converting them loses information.

My file uses semicolons — will it work?

Yes. Semicolon-separated files are the norm in much of Europe, where the comma is the decimal separator. The delimiter is detected automatically by counting candidates outside quoted regions, and you can override it if the guess is wrong.

What are nested keys for?

With nesting on, a column named user.name becomes a name property inside a user object rather than a flat key with a dot in it. Useful when the CSV is a flattened export of structured data you want to rebuild.

Is my data uploaded?

No. Parsing and conversion happen entirely in your browser. Nothing is transmitted, which matters if the CSV contains customer records or anything else confidential.

Was this tool helpful?

Share:

Guide

How to convert CSV to JSON and control how values are read

This converter turns CSV or TSV text into a JSON array with one object per row. It parses quotes as RFC 4180 describes, so "Hopper, Grace" stays one value, a doubled quote inside quotes becomes a single quote character, and a line break inside a quoted field is kept. A UTF-8 byte-order mark is removed so it does not pollute the first column name.

The decisions that matter sit in a few options: the delimiter, whether the first row holds names, whether number-like text becomes a real number, and whether dotted column names become nested objects.

Step by step

  1. Paste text into the CSV input box, or drop a .csv, .tsv or .txt file on the drop area. The box starts with a three-row sample; Sample and Clear reset it.
  2. Read the badge above the box, for example Comma, 5 columns, 3 rows. It shows what the parser found.
  3. In the options panel, leave Delimiter on Detect automatically or force Comma, Semicolon, Tab or Pipe. The panel appears once the input produces at least one row.
  4. Set First row is a header, Convert numbers and booleans, Trim whitespace (all on by default), plus Omit empty values, Expand a.b into nested objects and Minify output (off by default).
  5. Check the Parsed table preview of the first six rows, and read any amber warning about duplicate or uneven columns.
  6. Press Copy, or Download .json, which uses your file name with a .json ending.

When this is useful

  • Turning a spreadsheet export of products or orders into JSON for an API request or mock data file.
  • Converting a semicolon-separated export from a European tool or a bank.
  • Rebuilding structured records from a flattened export with headers such as address.city.
  • Checking what a messy CSV contains before importing it, using the grid preview.

Worked example: A semicolon file with a nested column

Input: header order_id;customer.name;customer.city;amount;paid;note, then 0042;Asha Rao;Pune;1499.50;true; and 0043;"Verma, Ravi";Delhi;250;false;"Call after 6 (line break) pm". Semicolon is detected. With conversion, omit empty values and nesting on, you get two objects, 324 bytes in the pretty-printed view. The first is {order_id: "0042", customer: {name: "Asha Rao", city: "Pune"}, amount: 1499.5, paid: true}. The second adds note, with amount 250 and paid false. Row one has no note key.

Tips for better results

  • Detection counts commas, semicolons, tabs and pipes outside quotes in the first five lines and picks the most frequent. A one-column file falls back to comma.
  • Conversion turns integers, decimals and exponents such as 1e3 into numbers, and true, false and null in any letter case into JSON values.
  • Turn conversion off when every value must stay text, which is safest for IDs, phone numbers and postal codes.
  • Without Omit empty values, an empty cell becomes an empty string, not null.
  • Without a header row, keys are column_1, column_2 and so on. A blank header gets the same style of name.

Common mistakes

  • Writing numbers in Indian grouping such as 1,00,000 without quotes. The commas split the field. Quote the value; it stays a string because it is not a plain number.
  • Assuming quotes protect a value from conversion. The parser does not remember a field was quoted, so "123" becomes 123. Turn conversion off.
  • Trusting very long numbers. Past about 15 digits precision is lost: 12345678901234567890 becomes 12345678901234567000. Disable conversion for ID columns.
  • Opening a Windows-1252 export with accented names. Files are read as UTF-8, so characters may look garbled. Re-save as UTF-8 first.
  • Ignoring the amber warning. Short rows are padded with empty values.

Your files and privacy

Parsing and conversion run in your browser, and pasted text or dropped files are read locally, not uploaded or saved by the tool. The page only records that the tool was opened, with an anonymous session identifier.

Frequently asked questions

What happens with duplicate column names?

The first keeps its name and later ones get a suffix, so name, name, name become name, name_2 and name_3. An amber warning appears. This stops later columns overwriting earlier ones.

Why did a number stay as text?

Only whole-field plain numbers convert. Leading zeros, a plus sign, thousands separators, comma decimals or a bare decimal point such as .5 stay text. This is deliberate, so identifiers are not corrupted.

Can it output arrays instead of objects?

No. The output is always an array of objects keyed by the header row or generated column_N names. Minify only changes whitespace.

How do nested keys behave?

A header such as customer.name builds a customer object holding name. If another column already put plain text under customer, a later dotted column replaces it, so avoid mixing both styles.

Does it handle large files?

The tool sets no limit, but the file is parsed in the page and the JSON rebuilt whenever an option changes, so multi-megabyte files may feel slow. Test a slice first.

Guide reviewed 2026-10-11 by the useToolify team.