CSV ↔ JSON Converter
Convert between CSV and JSON formats with auto-detected delimiters. 100% client-side.
How to Use the CSV ↔ JSON Converter
- Choose your conversion direction — CSV to JSON (default) or JSON to CSV.
- Paste your data into the input area on the left (or top on mobile).
- Select a delimiter — Auto-detect (default), Comma, Tab, Semicolon, or Pipe.
- View the result — converted data appears instantly on the right.
- 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.