TonySkill

CSV to JSON

Convert a CSV file or snippet to JSON instantly. Headers, auto-detected delimiter (comma, semicolon, tab), numbers recognised. Everything runs in your browser.

Accepted: JSON, CSV, TSV, XML, YAML, YML, TXT, TAB · Max 50 MB per file

Processed on your device. Only tools that say so send a file to our server.

Tip: paste text anywhere on the page (Ctrl+V).

How to convert CSV to JSON

  1. Drop your CSV file, or paste its content directly.

  2. The JSON appears right next to it; adjust the options if needed. An error? Its line is shown.

  3. Copy the result or download the JSON file.

Why use this tool

Four formats, every direction
CSV (comma, semicolon, tab), JSON, XML and YAML. The input format is detected and the result updates with every keystroke.
Errors explained
A missing comma, a badly closed tag, wrong indentation: the line and column are shown, the line is highlighted and “Go to error” puts the cursor there.
Useful settings
CSV headers and delimiter, number detection, indentation, key sorting, XML element names, Excel-friendly CSV. Table preview of the first 100 rows.
Nothing leaves your device
The conversion runs in your browser: your data is never sent to a server, even 50 MB files.

To convert a CSV file to JSON, drop it above or paste its content: each row becomes a JSON object whose keys are the column names from the first row, and the result appears next to it as you type. The delimiter (comma, semicolon, tab or pipe) is detected automatically, numbers and booleans are recognised, and nothing is uploaded: the conversion runs in your browser. Copy the JSON or download it as a file, up to 50 MB.

A small example

This CSV, with a header row:

  • Row 1 (headers): name;age;city
  • Row 2: Ana;32;Lyon
  • Row 3: Tom;007;Nice

gives a list of two objects: one with name “Ana”, age 32 (a number) and city “Lyon”, one with name “Tom”, age “007” and city “Nice”. The leading zeros of “007” are kept, so the value stays text: this protects codes, postal codes and identifiers. The semicolon was detected on its own.

The settings

SettingWhat it doesDefault
1st row = headersThe first row gives the keys. Switched off, each row becomes a plain list of valuesOn
DelimiterComma, semicolon, tab or pipe, or auto-detectAuto
Recognise numbers and booleansTurns 12 or 3.5 into numbers, true and false into booleans, null into null; a number with a leading zero, or 16 characters or more, stays textOn
Indentation2 or 4 spaces, tab, or minified on one line2 spaces
Sort keysSorts the keys of every object alphabeticallyOff

Empty header cells are named field1, field2… and duplicate headers get a numeric suffix (name, name_2), so no column is lost. A row with more values than headers keeps the extra ones under the names field4, field5… (the number is the column position). A row with fewer values gets empty text for the missing ones.

When the CSV has a problem

A line whose number of fields differs from the first line is reported with its line number and the expected and found counts, and an unclosed quote is reported with its line. Fields in quotes may contain line breaks and delimiters: they are read as one value.

Common cases

  • An export from Excel: save as CSV, drop it here. A semicolon delimiter (common with French settings) is detected without any action.
  • Data for a web page or an API: switch off “Recognise numbers” only if you need every value as text.
  • The other way round: JSON to CSV flattens nested objects into columns such as address.city.
  • Several formats: the Data converter goes between CSV, JSON, XML and YAML, and the JSON formatter cleans the result.
  • To edit the table first: open it in the CSV editor or the online spreadsheet.

Limits and privacy

  • Size: 50 MB at most. Above 1,000,000 characters the text boxes only show an extract, and the full file stays available to download.
  • Privacy: the conversion runs in your browser, your data is never sent to a server.

Something wrong with this tool?

More data tools

  • Data converterSwitch between data formats: CSV, JSON, XML or YAML. The source format is detected automatically.FreeNo sign-up
  • JSON to CSVA list of JSON objects becomes a CSV table ready for Excel. Nested objects are flattened into columns.FreeNo sign-up
  • XML to JSONTurn an XML document into readable JSON: attributes prefixed with @, repeated elements grouped into arrays.FreeNo sign-up
  • JSON to XMLProduce well-formed XML from JSON. Root and item names adjustable, keys fixed up when needed.FreeNo sign-up
  • CSV editorOpen a CSV in a real spreadsheet: delimiter detected, accents kept, save as CSV or Excel.FreeNo sign-up
  • CSV to XLSXOpen a CSV in Excel without broken accents or columns.FreeNo sign-up