CSV to JSON Converter
Use this free online converter to transform CSV text into JSON arrays. Ideal for importing spreadsheet data into apps, APIs, or NoSQL databases.
Use this free online converter to transform CSV text into JSON arrays. Ideal for importing spreadsheet data into apps, APIs, or NoSQL databases.
Convert comma-separated values into structured JSON arrays with this free online CSV to JSON converter. Perfect for importing spreadsheet data into APIs, databases, or web apps.
Input CSV:
name,age John,30 Jane,25
Output JSON:
[
{ "name": "John", "age": "30" },
{ "name": "Jane", "age": "25" }
]
CSV has no single governing grammar, although RFC 4180 documents the common convention: one record per line, fields separated by commas, and an optional header row. This converter uses the first non-empty line as the list of property names and turns every later line into one object. Because it splits on newlines and commas only, a field must not contain a comma or line break. Blank lines are skipped, header names are trimmed, and each value becomes a string. Jane,25 under the headers name,age becomes name Jane and age 25, both as text.
Rows rarely match the header perfectly, so it helps to know what happens at the edges. If a row has fewer values than the header, the missing properties are filled with empty strings. If a row has more values, the extra ones are ignored because there is no header to name them. Numbers, booleans and dates all stay as text, since CSV carries no type information. After conversion, decide in your own code whether age should be a number. The output is an array of objects printed with two-space indentation, ready to paste into a script or API request.
The first line should be column headers. Each following line should match the number of headers.
No, this version assumes simple CSVs. Advanced CSV parsing with quoted fields isn't yet supported.
No. Everything runs in your browser and is never uploaded or saved.
The missing properties are still created and set to an empty string, so every object in the output has the same set of keys. Rows with extra values simply have the surplus ignored.
CSV stores only text and has no way to mark a column as numeric, so the converter keeps every value as a string. Convert specific fields to numbers in your own code after parsing.