Diysb Tools

Convert CSV to JSON

Convert CSV files to JSON format with customizable options for delimiters, quotes, and output formatting. Support for headers, comments, and dynamic type conversion.

CSV Tools

What Is a CSV to JSON Converter?

This tool transforms Comma Separated Values (CSV) files to JavaScript Object Notation (JSON) data structures. It supports various CSV formats with customizable delimiters, quote characters, and comment symbols. The converter can treat the first row as headers, skip empty lines, and automatically detect data types like numbers and booleans. The resulting JSON can be used for data migration, backups, or as input for other applications.

Input CSV
Output JSON
Tool options
Input CSV Format
Column Separator (e.g., , ; \t)
Field Quote (e.g., ")
Comment Symbol (e.g., #)
Conversion Options
Treat the first row as column headers
Ignore empty lines in the input CSV
Automatically convert numbers and booleans
Convert CSV to JSON Examples

Basic CSV to JSON Array

Convert a simple CSV file into a JSON array structure.

name,age,city John,30,New York Alice,25,London
name,age,city John,30,New York Alice,25,London
[ { "name": "John", "age": 30, "city": "New York" }, { "name": "Alice", "age": 25, "city": "London" } ]
[ { "name": "John", "age": 30, "city": "New York" }, { "name": "Alice", "age": 25, "city": "London" } ]
Input CSV Format
Column Separator (e.g., , ; \t)
Field Quote (e.g., ")
Comment Symbol (e.g., #)
Conversion Options
Treat the first row as column headers
Ignore empty lines in the input CSV
Automatically convert numbers and booleans

CSV with Custom Delimiter

Convert a CSV file that uses semicolons as separators.

product;price;quantity Apple;1.99;50 Banana;0.99;100
product;price;quantity Apple;1.99;50 Banana;0.99;100
[ { "product": "Apple", "price": 1.99, "quantity": 50 }, { "product": "Banana", "price": 0.99, "quantity": 100 } ]
[ { "product": "Apple", "price": 1.99, "quantity": 50 }, { "product": "Banana", "price": 0.99, "quantity": 100 } ]
Input CSV Format
Column Separator (e.g., , ; \t)
Field Quote (e.g., ")
Comment Symbol (e.g., #)
Conversion Options
Treat the first row as column headers
Ignore empty lines in the input CSV
Automatically convert numbers and booleans

CSV with Comments and Empty Lines

Process CSV data while handling comments and empty lines.

# Comment id,name,active 1,John,true 2,Jane,false 3,Bob,true
# Comment id,name,active 1,John,true 2,Jane,false 3,Bob,true
[ { "id": 1, "name": "John", "active": true }, { "id": 2, "name": "Jane", "active": false }, { "id": 3, "name": "Bob", "active": true } ]
[ { "id": 1, "name": "John", "active": true }, { "id": 2, "name": "Jane", "active": false }, { "id": 3, "name": "Bob", "active": true } ]
Input CSV Format
Column Separator (e.g., , ; \t)
Field Quote (e.g., ")
Comment Symbol (e.g., #)
Conversion Options
Treat the first row as column headers
Ignore empty lines in the input CSV
Automatically convert numbers and booleans