Our Network


Coming Soon


Coming Later

CSV to JSON Converter

World's Simplest JSON Tool

Free online CSV to JSON converter. Just load your CSV in the input field and it will automatically get converted to JSON. In the tool options, you can adjust the input CSV format by specifying the CSV delimiter symbol, quote symbol, and comment symbol. Additionally, you can configure the conversion process and turn column headers into JSON keys, activate dynamic data types, skip empty CSV lines, and choose the JSON indentation format. Created for developers by developers from team Browserling.

᠎᠎᠎          Tool Options

CSV Format Options

Comma (,) or another symbol
used to separate CSV fields.
Double quotes (") or another
symbol used for field quoting.
Hash (#) or another symbol
used to denote the start of
comment lines.

Conversion Options

Create JSON objects where the
column names become the
keys in associative objects.
If a CSV value is a number or a
boolean, print it in the output
JSON without quotes.
If a CSV row has no symbols,
do not print it in the output
JSON.

JSON Indentation Options

Create hierarchical JSON
structure with two-space
indentation.
Create hierarchical JSON
structure with tab
indentation.
Create compact JSON
without additional
indentation.

What Is a CSV to JSON Converter?

This tool converts data from CSV format (Comma Separated Values) to JSON (JavaScript Object Notation) format. CSV is a tabular text file with data organized in rows and columns, which are separated by commas. It's commonly used for exporting data from databases and spreadsheets. JSON is a structured text format based on key-value pairs and nested arrays and objects, and it's ideal for exchanging data between programming languages, applications, and online services. Converting CSV to JSON makes it easy to import data from databases and spreadsheets into web applications and APIs. When you load a CSV file in the tool's input, you can customize options for its format. Specifically, you can specify the delimiter, quote, and comment characters used in your CSV file. By default, these characters are comma (,) for the delimiter, double quotes (") for quoting, and the hash symbol (#) for the comment character. If you're working with custom CSV files, you can change them. For example, if you're working with a semicolon-separated file, then you can set the delimiter to a semicolon (;), or if your file contains comments that start with two slashes (//), you can set them as the comment symbol. You can also fine-tune the conversion process. Specifically, you can create JSON objects where CSV column headers are used as keys in the associative objects. This can be controlled via the "Convert Headers to Keys" option. If this option is off, then a JSON array with nested arrays containing corresponding CSV rows will be created. Additionally, the tool can automatically detect numeric or boolean values in the CSV data and convert them to real JSON values (without quotes), preserving their data types. You can also customize JSON indentation and prettify it using two spaces or one tab per indentation level, or output a compact JSON without indentation. Last but not least, you can exclude CSV rows that contain no symbols (empty records). For the reverse data conversion from JSON to CSV, you can use our Convert JSON to CSV program. Json-abulous!


CSV to JSON Converter Examples

Click to try!

Transform Student Grades in CSV Format into JSON Format

This example converts a CSV file containing student grades into a JSON array with two associative objects. It enables the "Convert Headers to Keys" option to convert the column names on the first row of CSV into JSON object keys. As a result, the grade information is printed as a data structure that can be imported into JavaScript for further analysis. Additionally, the JSON output is prettified and printed hierarchically with two spaces per indentation level.

name,grade,level,gpa Kai,89,B,3.7 Jad,79,C,2.8
[ { "name": "Kai", "grade": "89", "level": "B", "gpa": "3.7" }, { "name": "Jad", "grade": "79", "level": "C", "gpa": "2.8" } ]
Required options
These options will be used automatically if you select this example.
Comma (,) or another symbol
used to separate CSV fields.
Double quotes (") or another
symbol used for field quoting.
Hash (#) or another symbol
used to denote the start of
comment lines.
Create JSON objects where the
column names become the
keys in associative objects.
If a CSV value is a number or a
boolean, print it in the output
JSON without quotes.
If a CSV row has no symbols,
do not print it in the output
JSON.
Create hierarchical JSON
structure with two-space
indentation.

Convert a Two-column CSV into a JSON Array

In this example, a two-column and four-row CSV file is converted into a JSON array. As the input CSV contains empty lines, the "Skip Empty Lines" option is turned on to ensure data integrity. In the output, the program prints a JSON array containing another four subarrays, where each inner array corresponds to a single non-empty CSV row.

winter,cold spring,warm summer,hot autumn,chilly
[["winter","cold"],["spring","warm"],["summer","hot"],["autumn","chilly"]]
Required options
These options will be used automatically if you select this example.
Comma (,) or another symbol
used to separate CSV fields.
Double quotes (") or another
symbol used for field quoting.
Hash (#) or another symbol
used to denote the start of
comment lines.
Create JSON objects where the
column names become the
keys in associative objects.
If a CSV value is a number or a
boolean, print it in the output
JSON without quotes.
If a CSV row has no symbols,
do not print it in the output
JSON.
Create compact JSON
without additional
indentation.

Dynamic Type Conversion

In this example, we enable dynamic type conversion. It automatically identifies numeric and boolean values in CSV data and outputs them as JSON values without quotes. In the input, we load store inventory CSV data, and in the output, we get JSON data with nested objects containing information about the product's id, name, price, and availability. Additionally, we use the "#" symbol as a comment marker to skip the last incomplete CSV line during the conversion.

id,product,price,in_stock 101,Laptop,1000,true 102,Monitor,250,true 103,Camera,500,false 104,Mouse,30,false #105,Keyboard
[ { "id": 101, "product": "Laptop", "price": 1000, "in_stock": true }, { "id": 102, "product": "Monitor", "price": 250, "in_stock": true }, { "id": 103, "product": "Camera", "price": 500, "in_stock": false }, { "id": 104, "product": "Mouse", "price": 30, "in_stock": false } ]
Required options
These options will be used automatically if you select this example.
Comma (,) or another symbol
used to separate CSV fields.
Double quotes (") or another
symbol used for field quoting.
Hash (#) or another symbol
used to denote the start of
comment lines.
Create JSON objects where the
column names become the
keys in associative objects.
If a CSV value is a number or a
boolean, print it in the output
JSON without quotes.
If a CSV row has no symbols,
do not print it in the output
JSON.
Create hierarchical JSON
structure with tab
indentation.

Pro tips Master online json tools

You can pass input to this tool via ?input query argument and it will automatically compute output. Here's how to type it in your browser's address bar. Click to try!

https://onlinetools.com/json/convert-csv-to-json?input=name%2Cgrade%2Clevel%2Cgpa%0AKai%2C89%2CB%2C3.7%0AJad%2C79%2CC%2C2.8&char-delimiter=%252C&char-comments=%2523&char-quote=%2522&convert-headers=true&convert-skip-empty=true&convert-dynamic-types=false&formatting-spaces=true

All JSON Tools

Didn't find the tool you were looking for? Let us know what tool we are missing and we'll build it!
Quickly color-code the syntax of a JSON file.
Quickly beautify a JSON data structure.
Quickly compress a JSON file.
Quickly convert JavaScript data to a JSON string.
Quickly convert a JSON string to JavaScript data.
Quickly check JSON for errors and report them.
Quickly escape special JSON characters.
Quickly unescape an escaped JSON string.
Quickly convert a JSON data structure to an XML file.
Quickly convert an XML file to a JSON data structure.
Quickly convert a JSON data structure to a YAML markup.
Quickly convert a YAML markup to a JSON data structure.
Quickly convert a JSON file to a TSV file.
Quickly convert TSV data to a JSON file.
Quickly convert a JSON file to a CSV file.
Quickly convert CSV data to JSON data.
Quickly convert a JSON structure to binary JSON encoding.
Quickly convert JSON to a PNG, GIF, JPG, or BMP image.
Quickly create a screenshot from JSON code.
Quickly encode JSON to base64.
Quickly decode base64 to JSON.
Quickly convert JSON to URL-encoding.
Quickly convert URL-escaped JSON back to JSON.
Quickly convert JSON data to plain text.
Quickly edit a JSON file in a neat JSON editor in your web browser.
Quickly extract keys from objects in JSON data.
Quickly extract values from objects in JSON data.
Quickly reduce the nesting level of an array of arrays.
Quickly create a single-level JSON object from nested JSON objects.
Quickly rewrite JSON strings, keys, and values using escape codes.
Quickly obfuscate a JSON data structure.
Quickly remove certain information from a JSON data structure.
Quickly display detailed information about a JSON data structure.
Quickly convert a JSON file to properties file.
Quickly convert a properties file to a JSON file.

Coming Soon

These JSON tools are on the way!
Find JSON Keys/Values

Find keys and/or values that interest you in a JSON file.

Convert JSON to a List

Create a text list from a JSON array or object.

Convert a List to JSON

Create a JSON array from a text list.

Convert JSON to Form Data

Generate HTTP form data from a JSON object.

Convert Form Data to JSON

Generate JSON object from HTTP form data.

Convert JSON to HTML

Create a HTML table from keys and values of a JSON object.

Convert JSON to CSON

Convert a JSON file to a CSON file.

Convert CSON to JSON

Convert a CSON file to a JSON file.

Convert JSON to TOML

Convert a JSON config to a TOML config.

Convert TOML to JSON

Convert a TOML file to a JSON file.

Convert JSON to Bencode

Convert a JSON data structure to Bencode encoding.

Convert Bencode to JSON

Convert Bencode data to JSON data.

Convert JSON to JSONL

Convert a JSON file to a JSONL file.

Convert JSONL to JSON

Convert a JSONL file to a JSON file.

Convert BSON to JSON

Convert binary JSON data structure (BSON) to JSON.

Convert JSON to UBJSON

Convert a JSON file to a universal binary JSON (UBJSON).

Convert UBJSON to JSON

Convert universal binary JSON (UBJSON) to regular JSON.

Convert JSON to Message Pack

Serialize JSON data to binary MessagePack format.

Convert Message Pack to JSON

Unserialize binary MessagePack to a JSON struct.

Convert JSON to Protobuf

Serialize JSON data to binary Protobuf format.

Convert Protobuf to JSON

Unserialize binary Protobuf to a JSON struct.

Convert JSON to a LaTeX Table

Generate a LaTeX table from a JSON object.

Convert JSON to INI

Convert a JSON data file to an INI configuration file.

Convert INI to JSON

Convert an INI configuration file to JSON data file.

Truncate JSON

Loop over JSON structure and truncate all values or keys.

Find JSON Depth

Find the nesting depth of a JSON data structure.

Convert JSON to a Data URI

Convert a JSON data structure to a data URL.

Convert JSON to a PHP Array

Create a PHP data structure from a JSON data structure.

Convert a PHP array to JSON

Create a JSON data structure from a PHP data structure.

Compare Two JSON Files

Diff JSON files and show differences visually.

Sort JSON Object Keys

Lexicographically sort the order of JSON object keys.

Swap JSON Keys with Values

Exchange keys with values in a JSON file.

Create a Random JSON Array

Create a JSON array with random values.

Create a Random JSON Object

Create a JSON object with random keys and values.

Randomize a JSON Array

Randomly change the positions of array elements.

Randomize a JSON Object

Randomly change the order of key, value pairs.

Add Spacing to JSON

Add random spaces and newlines in a JSON file.

Tokenize JSON

Tokenize a JSON data structure.

Remove JSON Syntax

Remove all JSON syntax and leave just the values.

Change JSON Syntax

Change curly braces, commas, and quotes to other symbols.

Fix Quotes in JSON

Fix incorrectly quoted (usually single quote) keys and values.

Use Single Quotes in JSON

Make all keys and values in a JSON to be single-quoted.

Use Double Quotes in JSON

Make all keys and values in a JSON to be double-quoted.

Generate FakeSON

Create JSON that looks real but is fake (FakeSON).

Run jq

Execute a jq query on a JSON data structure.

Filter JSON

Filter keys and values that match a pattern.

Split a String into a JSON Array

Create a JSON array from a string.

Group a JSON Array

Create groups of JSON array items.

Merge JSON Arrays

Merge two or more JSON arrays together.

Compare JSON Arrays

Find differences in two or more JSON arrays.

Merge JSON Objects

Merge two or more JSON objects together.

Damage JSON

Introduce errors in a JSON data structure.

Fix JSON

Try to fix a damaged JSON to the best of our ability.

Create JSON Art

Convert images to valid JSON strings that look like ASCII art.

Visualize a JSON Structure

Create an abstract visualization of JSON's complexity.


Subscribe!

Subscribe to our updates. We'll let you know when we release new tools, features, and organize online workshops.

Enter your email here


Feedback. We'd love to hear from you! 👋



Didn't find the tool you were looking for? Let us know what tool we are missing and we'll build it!