Toolgebra/Tools/Data Conversion

CSV to JSON

Convert CSV files to JSON format

Data Conversioncsvjsonconverterformat
Input

Upload a CSV file to convert to JSON

0 / 1,000,000 characters

Parameters

Treat the first row as column headers

Remove all whitespace from JSON output

Choose indentation style for formatted JSON

Output

Output will appear here after executing the tool

Processing happens entirely in your browser - your data stays private

Documentation

How to Use

Upload a CSV file and convert it to JSON format with customizable output options. **Header Options:** - **First Row as Header (Yes):** Outputs an array of objects where each object has the header column names as keys. - **First Row as Header (No):** Outputs a simple array of arrays. **Formatting Options:** - **Minify JSON:** Removes all whitespace for compact output. - **Indentation:** Choose between tabs, 2 spaces, or 4 spaces for readable formatted output. The tool automatically handles different CSV formats and provides clean, valid JSON output.

Examples

Convert with headers to object array

Convert CSV with headers to array of JSON objects

Input:

Name,Age,City
John Doe,30,New York
Jane Smith,25,Los Angeles

Parameters:

{
  "firstRowAsHeader": true,
  "minifyJson": false,
  "indentation": "two-spaces"
}

Expected Output:

[ { "Name": "John Doe", "Age": 30, "City": "New York" }, { "Name": "Jane Smith", "Age": 25, "City": "Los Angeles" } ]

Convert without headers to array of arrays

Convert CSV data to simple nested arrays

Input:

John Doe,30,New York
Jane Smith,25,Los Angeles

Parameters:

{
  "firstRowAsHeader": false,
  "minifyJson": false,
  "indentation": "two-spaces"
}

Expected Output:

[ ["John Doe", 30, "New York"], ["Jane Smith", 25, "Los Angeles"] ]

Minified JSON output

Generate compact JSON without whitespace

Input:

Product,Price,Stock
Laptop,999.99,50
Mouse,29.99,200

Parameters:

{
  "firstRowAsHeader": true,
  "minifyJson": true
}

Expected Output:

[{"Product":"Laptop","Price":999.99,"Stock":50},{"Product":"Mouse","Price":29.99,"Stock":200}]

Custom indentation with tabs

Format JSON with tab indentation

Input:

ID,Status
1,Active
2,Inactive

Parameters:

{
  "firstRowAsHeader": true,
  "minifyJson": false,
  "indentation": "tabs"
}
Notes & Tips

**Tips:** - Use "First Row as Header" when your CSV has column names in the first row - Choose minified JSON for APIs or when file size matters - Use formatted JSON with indentation for human readability - The tool automatically detects data types (numbers, booleans, strings) - Empty cells are preserved as empty strings or null values **Output Format:** - **With Headers:** Array of objects like `[{"col1": "val1", "col2": "val2"}]` - **Without Headers:** Array of arrays like `[["val1", "val2"], ["val3", "val4"]]` **Limitations:** - Maximum file size: 10MB (configurable in tool settings) - Large files may take longer to process

Category
conversion
Version
1.0.0
Processing
Client-side
Max File Size
10 MB
CSV to JSON - Free Online Tool | Toolgebra