CSV to JSON Converter

Turns CSV exports into a JSON array of objects. Detects the delimiter, follows RFC 4180 quoting, handles line breaks inside cells and keeps every value exactly as text.

The output will appear here.
Advertisement Kelivo — a word game by icyabmod, on Google Play and the App Store

How CSV to JSON Converter works

Turns CSV exports into a JSON array of objects. Detects the delimiter, follows RFC 4180 quoting, handles line breaks inside cells and keeps every value exactly as text.

Input CSV
Output JSON
Works done 1,075

How to use it

This CSV to JSON converter turns a spreadsheet export or any delimited text into a JSON array in which each row becomes an object keyed by the header row. The delimiter is detected automatically, whether it is a comma, semicolon, tab or pipe, and quoting follows RFC 4180, so commas and line breaks inside quoted cells are read correctly. Your data is processed in the browser and never uploaded.

How to convert CSV to JSON

  1. Open the CSV in a text editor and copy it, or select the cells in your spreadsheet and copy them directly.
  2. Paste the text into the input box, making sure the first line holds the column names.
  3. Start the conversion with "Run tool" or Ctrl + Enter.
  4. Copy the indented JSON, or download it and rename the file to .json.

Cells copied straight from a spreadsheet arrive tab-separated, and tab is one of the detected delimiters, so copy and paste is often quicker than exporting a file.

A worked example

Here is a small export with a few awkward details:

name,price,price,
"Smith, John",19.90,"20,50",x,extra
"He said ""hi""", 5 ," spaced "

The result is an array of two objects. In the first, name is Smith, John because the comma sits inside quotes, the duplicate header becomes price_2, the empty fourth header becomes column_4, and the surplus fifth cell is stored as column_5. In the second, the doubled quotes turn into He said "hi", the unquoted 5 is trimmed to "5", and the quoted " spaced " keeps its spaces. The second object has no column_5 key at all, because that row has fewer cells.

Parsing rules in brief

SituationBehavior
DelimiterThe most frequent of , ; tab and | outside quotes on the first line; a tie goes to the comma
Quoted fieldDelimiters and line breaks inside it are part of the value
Doubled quote ""A literal quote character
Unquoted spacesTrimmed at both ends
Duplicate headerSuffixed with _2, _3 and so on
Empty header or extra cellNamed column_N by position
Missing cellEmpty string
Blank lineSkipped
Unclosed quoteError: Invalid CSV: a quoted field is not closed.

Why every value stays a string

The output never guesses types: 19.90 becomes "19.90" and true becomes "true". That is deliberate. Type guessing is where CSV conversions quietly corrupt data: ZIP codes such as 02134 lose their leading zero, long account numbers lose precision, and 3,5 is ambiguous between a list and a European decimal. Keeping text lets you convert each field in code, where you know what it means.

Common jobs

  • Seeding a database or mock API from a product list someone maintains in a spreadsheet.
  • Turning a translation sheet into the JSON language files your app loads.
  • Preparing fixtures for automated tests without hand-writing JSON.
  • Feeding a static site generator with data that non-developers edit.

The reverse direction is covered by the JSON to CSV converter, but the round trip is not symmetric: that tool flattens nested objects into columns like customer.name, while this one does not rebuild nesting from dotted headers and simply creates a flat key called "customer.name". The CSV vs JSON guide explains when each format fits.

Privacy

Parsing runs in JavaScript in your browser, which matters when the file is a customer list or an order export: the data is not sent to the server, and the page only increments an anonymous usage counter. To inspect or validate the output, paste it into the JSON formatter.

Advertisement Clicker Alchemist — a mobile game by icyabmod, on Google Play and the App Store

Frequently asked questions

Just paste it. The converter counts delimiters on the first line and picks the most frequent one, so files exported with semicolons, which is common in regions that use a comma as the decimal separator, convert without any setting. Values that contain semicolons must be wrapped in double quotes, as they would be in any correctly exported CSV. Tab- and pipe-separated text is detected the same way.

Every value is kept as a string because CSV carries no type information and guessing is risky. Automatic conversion strips leading zeros from ZIP codes and phone numbers, rounds long IDs and misreads decimals written with commas. Convert the fields you know to be numeric in your own code, for example with Number() or parseFloat(), and compare strings for boolean columns.

Yes, as long as the cell is enclosed in double quotes, which is how spreadsheets export multi-line cells. The converter keeps the line break inside the value, and it appears as \n in the JSON string. If the closing quote is missing, the parser cannot tell where the cell ends and reports that a quoted field is not closed; check for an unescaped quote inside the text.

The first line is always used as the header, so in a headerless file your first data row would become the keys. Add a line with column names at the top before converting. Short, lowercase names without spaces, such as sku, title and price, are easiest to work with afterwards, because you can access them in code with simple dot notation.