CSV ↔ JSON Converter

Convert between CSV and JSON formats with auto-detected delimiters. 100% client-side.

Input
Output
Paste CSV or JSON above to convert.

How to Use the CSV ↔ JSON Converter

  1. Choose your conversion direction — CSV to JSON (default) or JSON to CSV.
  2. Paste your data into the input area on the left (or top on mobile).
  3. Select a delimiter — Auto-detect (default), Comma, Tab, Semicolon, or Pipe.
  4. View the result — converted data appears instantly on the right.
  5. Copy or download — use the buttons above the output to copy or download the result.

What This Tool Does

This converter transforms data between CSV (Comma-Separated Values) and JSON (JavaScript Object Notation) formats. For CSV to JSON, it reads the first row as headers and converts each subsequent row into a JSON object. For JSON to CSV, it takes an array of objects, extracts all unique keys as headers, and generates properly quoted CSV output.

Features

  • Bidirectional conversion — CSV to JSON and JSON to CSV in one tool
  • Auto-detect delimiter — automatically identifies commas, tabs, semicolons, or pipes
  • RFC 4180 compliant — handles quoted fields, escaped quotes, and embedded delimiters
  • Pretty-printed JSON — output JSON is formatted with 2-space indentation
  • Proper CSV quoting — fields containing delimiters, quotes, or newlines are properly escaped
  • Privacy — all processing happens in your browser, no data is ever uploaded

CSV Format Rules (RFC 4180)

The CSV format, standardized in RFC 4180, has specific rules: fields are separated by the delimiter (usually a comma), records are separated by newlines, and fields containing the delimiter, double quotes, or newlines must be enclosed in double quotes. Within a quoted field, a double quote is escaped by doubling it (""). This tool handles all of these cases correctly.

Delimiter Detection

When auto-detect is enabled, the tool analyzes the first line of your CSV data and counts the frequency of each potential delimiter character (comma, tab, semicolon, pipe). The character that appears most frequently and consistently is chosen as the delimiter. This works well for most real-world data files, but you can always override the detection by manually selecting a delimiter.

JSON to CSV: Handling Nested Objects

When converting JSON to CSV, flat objects (where all values are strings, numbers, or booleans) map directly to CSV columns. Nested objects and arrays are converted to their JSON string representation in the CSV cell. For deeply nested data, consider flattening your JSON first using a tool like the JSON Formatter, then converting to CSV.

Common Use Cases

Developers and data analysts frequently need to convert between CSV and JSON when importing data into databases, processing API responses, creating data visualizations, migrating between systems, or preparing data for spreadsheets. This tool handles all of these workflows without requiring any software installation or data uploads. Once converted, format your JSON output with our JSON Formatter, or convert between other formats using the YAML Converter and SQL Formatter.

RFC 4180 Compliance

This converter follows the RFC 4180 standard for CSV parsing. Fields containing commas, double quotes, or newlines are enclosed in double quotes. Double quotes within quoted fields are escaped by doubling them. The first row is treated as a header row when converting to JSON, producing an array of objects with named keys rather than a flat array of arrays.

Frequently Asked Questions

The converter reads the first row of the CSV as column headers. Each subsequent row becomes a JSON object where the keys are the header names and the values are the corresponding cell values. The result is a JSON array of objects. Quoted fields, escaped quotes, and various delimiters are handled automatically.
This tool supports comma (,), tab, semicolon (;), and pipe (|) delimiters. By default, it auto-detects the delimiter by analyzing the frequency of each character in the first line. You can also manually select a specific delimiter using the chips below the mode selector.
No. All CSV and JSON conversion happens entirely in your browser using JavaScript. Your data never leaves your device. There is no server-side processing, no logging, and no data collection.
The parser correctly handles RFC 4180 CSV rules: fields enclosed in double quotes can contain the delimiter character, newlines, and escaped double quotes (represented as two consecutive double quotes). For example, the field "Hello, World" with a comma inside is treated as a single value.
The JSON input must be an array of objects, like [{"name": "Alice", "age": 30}, {"name": "Bob", "age": 25}]. The converter extracts all unique keys from all objects to form the CSV header row, then outputs each object as a row. Missing values are output as empty fields.