tooly

Convert CSV to JSON online

Paste a CSV export and get an array of JSON objects ready for an API, a script or a config file — delimiter detected automatically, nothing uploaded.

Everything runs in your browser — nothing is sent anywhere

How to use

  1. 1

    Paste your CSV — the first row must be the header.

  2. 2

    Keep “detect numbers and booleans” on unless every value should stay a string.

  3. 3

    Copy the JSON or download it as a file.

Why turn a spreadsheet into JSON

CSV is what spreadsheets, CRMs, banks and analytics dashboards export. JSON is what web APIs, JavaScript code, NoSQL databases and most configuration systems consume. The conversion comes up constantly: seeding a test database from a sheet a colleague maintains, turning a product list into fixtures for a front-end prototype, feeding a list of redirects or translations into a build script, or posting a batch of records to an API that only accepts JSON.

The output here is a JSON array with one object per data row. The header row supplies the property names, so a sheet with columns sku, title and price becomes objects with exactly those three keys, ready to loop over.

How the parser reads your CSV

CSV looks trivial until a value contains the separator. The parser follows the rules of RFC 4180, the closest thing CSV has to a standard:

  • A field wrapped in double quotes may contain the delimiter, line breaks and quotes. "Smith, John" stays one value.
  • A quote inside a quoted field is written twice: "6"" pipe" becomes 6" pipe.
  • Lines may end with Windows-style CRLF or Unix-style LF; both are handled.
  • A byte order mark at the start, which Excel adds when saving as CSV UTF-8, is removed so it does not end up glued to the first column name.
  • Completely empty lines are skipped.

The delimiter is chosen by counting commas, semicolons, tabs and pipes in the first line and picking the most frequent. That works for almost every export, but it relies on the header being representative. If your header is a single column with no separators, the comma is assumed.

Spaces around header names are trimmed, so price becomes the key price. Values in the data rows are kept exactly as written, including any leading or trailing spaces.

Typed values versus strings

With "Detect numbers and booleans" switched on, each cell is checked against a short list of rules:

  • Plain integers and decimals such as 42, -7 and 19.99 become JSON numbers, as long as they have at most 15 digits.
  • Exactly true and false, in lower case, become booleans. TRUE, Yes or 1 stay as they are.
  • An empty cell becomes null.
  • Everything else, including longer digit strings, 1.5e3, +5, .5, 1,234 and dates, stays a string.

This is convenient for most data, but numbers in JSON carry no formatting, so some values change meaning when typed:

  • Leading zeros disappear. A US ZIP code 02134 becomes 2134, and an article number 007 becomes 7.
  • Long digit strings would lose precision. JavaScript numbers are exact only to about 15 significant digits, so values with more digits, such as a 20-digit order ID or a card number, are kept as strings instead of being rounded.
  • Phone numbers without a plus sign or spaces become numbers too.

If any column holds identifiers rather than quantities, switch the option off and convert the few genuinely numeric fields in your own code. With the option off, empty cells become empty strings instead of null.

When the output looks wrong

  • Everything lands in one key. The delimiter was not detected, usually because the header has a different separator from the data, or no separator at all. Check the first line.
  • Values are shifted by one column. A field contains the delimiter but is not quoted. Re-export from the source application rather than editing by hand; spreadsheets quote such fields automatically.
  • Extra columns vanish. Keys come only from the header, so cells beyond the last header column are dropped. Rows with fewer cells get null or an empty string for the missing ones.
  • Two columns, one key. If the header repeats a name, the later column overwrites the earlier one in every object. Rename one of them first.
  • Strange characters such as é. The file was saved in a legacy encoding. Save it again as CSV UTF-8 and paste it once more.

Working with the result

The JSON is printed with 2-space indentation, which is fine for reading and for committing to a repository. To minify it for an API request or reindent it, run it through the JSON formatter. To go back the other way after editing, JSON to CSV rebuilds a sheet from the array. The conversion runs entirely in the page, which matters when the export contains customer names, emails or salaries.

FAQ

Which delimiters are supported?

Comma, semicolon, tab and pipe are detected from the first line automatically.

Are quoted fields handled?

Yes — quotes, embedded commas, line breaks inside quotes and doubled quotes follow RFC 4180.

What does “detect numbers and booleans” do?

“42” becomes 42, “true” becomes true and empty cells become null. Digit strings longer than 15 digits stay strings so they keep their exact value. Turn it off to keep everything as strings, e.g. for ZIP codes with leading zeros.

Is my data uploaded?

No. Parsing happens in your browser.

Can I convert Excel files?

Save the sheet as CSV first (File → Save as → CSV UTF-8), then paste it here.

Related tools