Skip to content

CSV to JSON Converter

Convert CSV to JSON: comma, semicolon or tab files, header row, quoted fields and line breaks, with numbers detected only if you ask. Runs in your browser.

Runs in your browser

Everything happens on your device: nothing you paste or type is sent to our server or stored. A share link holds your settings, and your input only if you choose to include it.

Files saved by Excel in much of Europe use semicolons, because the comma is the decimal separator there.

On: an array of objects named by the header. Off: an array of arrays.

CSV has no types. Detecting turns 42 and true into JSON numbers and booleans; leading-zero codes (01234), decimal commas (1,5), long IDs and quoted values stay text.

151 characters · 153 bytes (UTF-8) · limit 20 MB

Output: 387 characters.

Delimiter
Comma (,), detected
Rows
3
Columns
5
Input size (bytes)
153
Output size (bytes)
389

Method: CSV, RFC 4180 → JSON, RFC 8259 · FindMySum reader (no library), RFC 4180 (2005)

Off by default. When on, your input is packed into the part of the link after “#”, which browsers never send to any server; anyone you give the link to will see it.

How it works

The reader follows RFC 4180, the closest thing CSV has to a standard. A field in double quotes may contain the delimiter, line breaks and quotes (written twice, as ""). Records end with CRLF, LF or a lone CR, and the last one may have no line break. Lines with nothing on them are skipped. A quote that never closes, or text straight after a closing quote, stops the conversion and shows the line and column, because guessing would silently shift every later value into the wrong column.

The delimiter is detected from the first lines: the character among comma, semicolon, tab and pipe that appears the same number of times on most lines wins. With a header row, each later row becomes an object whose keys are the header names; repeated or empty names are renamed (name_2, column_3) so no value is lost. Without one, each row becomes an array.

CSV has no types, so every value stays text unless you choose to detect numbers and true/false. Even then, only values written exactly as a JSON number are converted: 01234, 1,5, 1 000 and IDs longer than a JavaScript number can hold stay text, and anything in quotes stays text. The conversion runs in your browser with our own code; the file never leaves your device.

Standards this tool follows

CSV to JSON: Convert Spreadsheet Rows to JSON Objects

By FindMySum · Last reviewed

Use this CSV to JSON converter to turn a spreadsheet export into a JSON array that a program, an API or a database import can read. Paste the CSV above and the JSON appears as you type. The conversion happens in your browser, so customer lists and other private exports stay on your computer.

Where CSV comes from

Almost every spreadsheet, accounting package and admin dashboard can export CSV: plain text, one row per line, values separated by commas. It is easy to produce and hard to read reliably, because the format was never strictly defined. RFC 4180 wrote down the common practice in 2005, and this tool follows it, along with the variations real files use: semicolons and tabs as separators, Windows, Unix and old Mac line endings, and the invisible byte order mark Excel puts at the start of UTF-8 files.

How to use it

  1. Paste the CSV, or open the file in a text editor and copy everything.
  2. Keep "First row is the header" on when the first line names the columns. Turn it off to get plain arrays.
  3. Decide about types. Leaving values as text is the safe choice; detecting numbers is convenient when a column really is numeric.
  4. Pick how empty cells should appear (an empty string or null), and the indentation.
  5. Copy or download the JSON.

A worked example

This export has a header, a value with a comma inside quotes, and a postal code with a leading zero:

id,name,postal_code
1,"Hopper, Grace",02134
2,Ada Lovelace,NW1 6XE

With the defaults, the result is:

[
  {
    "id": "1",
    "name": "Hopper, Grace",
    "postal_code": "02134"
  },
  {
    "id": "2",
    "name": "Ada Lovelace",
    "postal_code": "NW1 6XE"
  }
]

The quoted comma stayed inside the name. With number detection on, id becomes 1 and 2, while 02134 stays text: as a number it would lose its zero and become a different postal code.

Common mistakes

Letting a tool guess types. Converters that turn every numeric-looking value into a number turn ZIP codes into smaller numbers and long account numbers into rounded ones; spreadsheets famously turned the gene name SEPT2 into a date. Convert only the columns you know are numbers.

Opening and re-saving in a spreadsheet first. Spreadsheets apply their own guesses when they open a CSV file. Convert the original export instead.

Unquoted delimiters. A value such as Smith, John must be in double quotes in a comma-separated file, or it becomes two fields. The ragged-row warning points to the lines where this happened.

To go the other way, the JSON formatter checks JSON before you work with it, and the average calculator is handy for a quick look at a numeric column.

Sources

Frequently Asked Questions

Why are my numbers in quotes in the JSON?

By default every value stays text, because CSV doesn't say which columns are numbers and guessing breaks postal codes, phone numbers and product codes. Choose "Detect numbers and true/false" to turn plain numbers into JSON numbers. Leading-zero codes such as 01234 stay text either way.

My file uses semicolons. Will it work?

Yes. Leave the delimiter on automatic and it will pick the semicolon, which is what Excel writes in countries that use the comma as the decimal separator. Values such as 3,50 stay as the text "3,50"; the tool never assumes a decimal comma.

What happens when a row has too many or too few fields?

The conversion still runs, and a warning lists the lines that differ from the header. Missing fields come out empty (or null, if you choose), and extra fields get keys such as column_5. A row with too many fields usually means a value containing the delimiter was not put in quotes.

Is there a size limit?

The page converts up to 20 MB of text, which is hundreds of thousands of rows; anything over about 200 kB converts in a background worker, so the page stays responsive. Larger exports are best split first. Everything happens on your device, so speed depends on your computer, not on an upload.

Spotted a wrong result or a bug? Report a problem (the link sends the page address only, never what you entered).

May we count your visits with Invoker Analytics? It keeps a random visitor number in your browser. Your calculator inputs are never sent. Privacy policy