Developer

CSV ↔ JSON Converter

Convert CSV to JSON and JSON to CSV instantly

CSV and JSON: The Two Most Common Data Exchange Formats

Almost every developer, data analyst, or content manager encounters both CSV and JSON at some point. CSV is the lingua franca of spreadsheets and databases; JSON is the default format for web APIs and modern application configs. This converter bridges the gap between them β€” instantly and entirely in your browser.

When to Convert CSV to JSON

CSV-to-JSON conversion is needed when you want to:

  • Import a spreadsheet export into a web application or API that expects JSON.
  • Pre-process flat data before inserting it into a document database (MongoDB, Firestore).
  • Use a CSV file as a seed data source in a JavaScript or TypeScript project.
  • Convert a product catalogue, user list, or configuration table into a structured format for a front-end app.

When to Convert JSON to CSV

JSON-to-CSV conversion is useful when you need to:

  • Open API response data in Excel or Google Sheets for analysis.
  • Export records from a NoSQL database to a flat format for reporting.
  • Share structured data with non-technical stakeholders who use spreadsheet tools.
  • Import JSON-sourced data into a relational database via a CSV import wizard.

RFC 4180 β€” The CSV Standard

CSV does not have a single universal specification, but RFC 4180 is the closest thing to a standard. Key rules this converter follows:

  • Fields containing commas, double-quotes, or line breaks must be enclosed in double-quote characters.
  • A double-quote appearing inside a quoted field is escaped by preceding it with another double-quote.
  • Each record ends with a CRLF or LF line break.
  • The first record may optionally be a header row of column names.

Choosing a CSV Delimiter

While the comma is the standard separator, some regions and tools prefer other delimiters:

  • Comma (,) β€” Default in most English-language tools, English Excel, and RFC 4180.
  • Semicolon (;) β€” Default in Excel in many European countries where the comma is used as the decimal separator (Germany, France, Spain, etc.).
  • Tab (\t) β€” Tab-Separated Values (TSV) format; avoids ambiguity with commas in addresses and text fields.

Frequently Asked Questions

What is the difference between CSV and JSON?
CSV (Comma-Separated Values) is a plain-text format in which each row is a line and each field is separated by a delimiter β€” typically a comma, semicolon, or tab. JSON (JavaScript Object Notation) is a structured format that supports nested objects, arrays, null values, booleans, and numbers. CSV is ideal for tabular, spreadsheet-style data and is widely supported by Excel and database tools. JSON is the standard for APIs, web applications, and configurations that require typed or nested data.
Does this converter handle quoted fields with commas?
Yes. This converter correctly parses RFC 4180-compliant CSV, meaning fields wrapped in double quotes β€” including fields that contain commas, newlines, or embedded double quotes β€” are handled properly. A double-quote within a quoted field is represented as two consecutive double-quotes ("").
Can it auto-detect whether the delimiter is a comma, semicolon, or tab?
Yes. When converting CSV to JSON, the converter automatically detects the delimiter used in your file by examining the first line. Tab-separated (TSV) and semicolon-delimited files are both supported without any configuration.
What does "infer types" mean?
When "Infer types" is enabled, the converter automatically converts field values that look like numbers (e.g., "42" β†’ 42), booleans ("true" / "false"), and null to their native JSON types instead of leaving them as strings. If disabled, all values are output as JSON strings.
Can I convert nested JSON to CSV?
Nested JSON objects cannot be perfectly flattened to a flat CSV in all cases. This converter handles one-level objects in an array. If your JSON contains deeply nested objects or arrays within fields, those inner structures will be serialised to a string in the CSV cell. For complex nested data, consider flattening the JSON first.
How large a file can I convert?
This tool processes data entirely in your browser β€” nothing is uploaded to a server. Practical limits depend on your browser's available memory and JavaScript performance. Files up to a few MB typically convert in milliseconds. For very large datasets (10 MB+), a server-side tool or command-line utility like jq, csvkit, or pandas may be more appropriate.