>Fafa Dev Tools

CSV to JSON Converter

Convert CSV to JSON format online. Free tool with support for custom delimiters, headers, and pretty-print output.

0 chars
Output will appear here...

What is CSV to JSON Converter?

CSV (Comma-Separated Values) is a plain-text format for tabular data where each line is a row and columns are separated by commas. Converting CSV to JSON transforms this flat tabular data into structured JSON objects, making it easier to use in web applications, APIs, and NoSQL databases. The first row of CSV is typically treated as column headers.

How to Use

  1. Paste your CSV data in the input area — the first row should contain headers
  2. Select your delimiter (comma, semicolon, tab, or pipe) if not using the default comma
  3. Choose output format: JSON array of objects or array of arrays
  4. Toggle pretty-print for formatted output or keep it minified
  5. Copy the resulting JSON or download it as a .json file

Examples

Simple CSV to JSON

Inputname,age,city Alice,30,Beijing Bob,25,Shanghai
Output[ {"name": "Alice", "age": "30", "city": "Beijing"}, {"name": "Bob", "age": "25", "city": "Shanghai"} ]

Semicolon-delimited CSV

Inputproduct;price;stock Widget;9.99;100 Gadget;24.99;50
Output[ {"product": "Widget", "price": "9.99", "stock": "100"}, {"product": "Gadget", "price": "24.99", "stock": "50"} ]

Frequently Asked Questions

What if my CSV uses a different delimiter?

Select the delimiter from the dropdown: comma, semicolon, tab, or pipe (|). Some European locales use semicolons instead of commas. The tool will split columns accordingly.

Does it handle quoted fields with commas inside?

Yes. Fields enclosed in double quotes are parsed correctly even if they contain the delimiter character or newlines. For example, "Smith, John",25 will be treated as a single field.

Are all values converted to strings?

By default, all CSV values are treated as strings. JSON does not distinguish between the number 30 and the string "30". You can post-process the JSON to convert numeric fields if needed.