ToolBit

CSV to JSON Converter

Convert CSV to JSON in your browser.

JSON
Paste CSV or open a file

Runs in your browser. Nothing is uploaded.

Paste CSV, open a .csv or .txt file, or drop a file on the field. The JSON appears as you type, with a preview table of the first 50 rows. Download saves .json, or .jsonl for JSON Lines.

With Delimiter on Auto, the tool picks comma, semicolon or pipe from the first rows and shows what it detected. A first line such as sep=; sets the delimiter and is not data. Values stay strings, as written, unless you turn on “Detect numbers, booleans and empty cells”.

Example

Input:

id;name;note
007;Ada;"says ""hi"", twice"
008;Bob;

Output with the defaults (array of objects, 2 spaces):

[
  {
    "id": "007",
    "name": "Ada",
    "note": "says \"hi\", twice"
  },
  {
    "id": "008",
    "name": "Bob",
    "note": ""
  }
]

The delimiter is detected as semicolon, and the comma inside the quotes does not split the cell. With detection on, the last note becomes null; 007 stays a string either way.

Limitations

  • Input is limited to 1,000,000 bytes (1 MB), pasted or from a file. Larger input is refused.
  • Only comma, semicolon and pipe are supported, not tabs.
  • Files are read as UTF-8. If a file is not valid UTF-8, an Encoding select offers Windows-1252, Windows-1251 and ISO-8859-1. A leading byte order mark is ignored.
  • Headers are flat keys: user.name does not create a nested object, and you cannot pick a column as the object key. No .xlsx files, no JSON to CSV.
  • A short row gets "" for missing cells (null with detection); extra cells go under column_N keys.
  • Parsing is lenient: a quote inside an unquoted cell is kept as text, and text right after a closing quote is appended to the cell.
  • A quoted cell that is never closed gives an error with its line and column; the quote is selected and the previous output stays.
  • Output over 1 MB shows its first 200 lines; Copy and Download give everything.

FAQ

Why does my CSV use semicolons instead of commas?

Where the comma is the decimal separator (1,50), spreadsheets often separate cells with a semicolon. Microsoft documents that Excel saves CSV with the Windows list separator, a comma by default, and that it can be changed in the Windows region settings. Auto handles both; if it guesses wrong, pick one.

How are cells with commas or line breaks handled?

RFC 4180 says fields containing line breaks, double quotes or commas should be enclosed in double quotes, and a quote inside such a field is doubled. The tool follows this, so a quoted cell can hold delimiters and line breaks, which become \n in the JSON string.

Why are numbers not converted by default?

007, +370 600 00000 and 12345678901234567890 are text, and as numbers they would lose digits or their form. With detection on, only canonical JSON numbers become numbers, written as in the CSV: 1.50 stays 1.50, while 007 and 1,5 stay strings. Integers beyond ±9007199254740991 and numbers too large to store, such as 1e400, stay strings, with a note. true and false in any letter case become booleans.

What does “First row is a header” do?

On, the first row supplies the keys: empty names become column_1, column_2, and repeated names get _2, _3. Off, the output is arrays of values.

What is JSON Lines?

A text file with one JSON value per line, here one per CSV row. jsonlines.org specifies UTF-8, suggests the .jsonl extension and names log files as a typical use. Choose it under Shape; Indent then does not apply.