CSV

CSV to JSON Converter

Converts delimited rows into an array of JSON objects keyed by the header row.

Loading the tool…

Processing happens locally in your browser. What you paste or load is processed by this page and is not uploaded to a server. Nothing is stored unless you use a control that says it stores something, and you can clear anything this site has kept from the privacy page.

How to use this tool

  1. Paste the CSV, or choose a file.
  2. Decide whether numbers and booleans should become real JSON types.
  3. Select Convert to JSON, or Convert to JSON Lines for one record per line.
  4. Copy or download the result.

What csv to json does

CSV carries no type information at all: every field is text, and the difference between the number 42 and the string "42" simply is not recorded. Converting to JSON forces a decision about that. With type inference on, values that look like numbers and booleans become real JSON numbers and booleans, and empty fields become null; with it off, everything stays a string, which is safer for identifiers such as postcodes and product codes that start with a zero.

The header row becomes the object keys, so a file with columns id, name and city produces objects with exactly those three properties in that order. Rows with fewer fields than the header still get every key, with an empty value for the missing ones, which keeps the array uniform and makes it safe to feed into code that expects a consistent shape.

Frequently asked questions

Type inference turned it into a number. Turn off "Infer numbers and booleans" and every value stays a string, which is the right choice for identifiers, postcodes and product codes.

With type inference on it becomes null; with it off it becomes an empty string. Both are represented, so no key is ever missing from a record.

JSON produces one array containing every record. JSON Lines produces one compact JSON object per line, which streaming tools and log pipelines usually prefer because they can read it a record at a time.