CSV ⇄ JSON
Convert CSV to JSON and JSON to CSV with proper quoting, delimiters and header handling. Real CSV parsing (quoted fields, embedded commas and newlines) with instant row previews before you copy the result. Everything stays on your device.
Paste CSV or JSON, pick a direction and optionally the delimiter. Delimiter auto-detection and a 'first row is header' toggle produce clean objects. A row preview shows exactly what will be copied.
Input
JSON output
Waiting for input
Paste CSV to see the converted output.
Conversion happens locally with a proper CSV parser — quoted fields, embedded commas and newlines are handled correctly. Nothing is uploaded.
Learn more
What CSV and JSON each represent
CSV (comma-separated values) is the simplest structured-data format that still carries a table: the first row names each column, every following row is one record, and fields are separated by a delimiter — usually a comma, though tabs and semicolons are common variants. It has no concept of types, no nesting, and no metadata; everything is text, and meaning comes purely from position. That simplicity is exactly why it survives: any spreadsheet, database and programming language can read it, and a human can parse it with their eyes.
JSON (JavaScript Object Notation) is a hierarchical format built from just a few kinds of values: objects (key/value pairs), arrays (ordered lists), strings, numbers, booleans and null. Where CSV is flat and tabular, JSON is tree-shaped — values can nest inside objects to arbitrary depth, and arrays can hold any mix of value types. It's the default data format of the web because it maps directly onto the data structures of every modern programming language, at the cost of being far more verbose than CSV for simple tables.
CSV structure: headers, rows and delimiters
A CSV file's structure is deceptively simple: a header row defines column names, each subsequent line is a row, and fields are split on the delimiter. But the simplicity is where the pitfalls live. The delimiter isn't always a comma — European locales often use semicolons because commas are the decimal separator, and tab-separated values (TSV) are common in data pipelines. Any robust converter needs to auto-detect or let you choose the delimiter, or a European-format CSV parsed as comma-separated becomes a single mangled column.
RFC 4180, the closest thing CSV has to a spec, defines the quoting rules that make CSV more than "split on commas": fields may be wrapped in double quotes, and a quoted field can contain the delimiter, a newline, or even a double quote — written as two consecutive quotes (the escape). A field like "Smith, John" parses as one value, not two. The failure mode of naive parsers is that embedded newlines split a single record across multiple lines, silently corrupting data. This tool follows the RFC rules, so quoted fields with commas, quotes and newlines all survive the round trip.
JSON structure: objects, arrays and nesting
JSON's power is its recursive structure: an object's value can be another object, or an array, which itself contains objects, and so on. A single JSON document can represent a customer with a nested address object, an array of order line items, each with its own nested details — structure that has no natural CSV equivalent without flattening. Converting JSON to CSV therefore always involves a decision about what to do with nested values: flatten them to dotted keys (address.city), serialize them back to JSON text in one cell, or drop them.
The reverse direction — CSV to JSON — is where structure must be invented rather than recovered. CSV has no types, so a column of 1, 2, 3 could become numbers or strings depending on your downstream needs; a column with occasional empty cells needs a policy (null, empty string, or omitting the key entirely); and a header row with spaces or special characters becomes JSON keys that may not be convenient to work with. A good converter makes these decisions visible rather than silent, because the wrong choice here surfaces much later as a bug in consuming code.
Edge cases: commas, quotes, nulls and empty cells
The edge cases are where naive conversion breaks. Commas inside fields are the classic: without quoting, "Smith, John" becomes two fields. Quotes inside fields are subtler — a value like She said "hi" must be wrapped in quotes with the inner quotes doubled, or the parser terminates the field early. Embedded newlines inside quoted fields are the hardest case, because a line-oriented reader that doesn't understand quoting will split one record into two. RFC 4180 handles all of these, but the file in front of you may not be RFC-compliant at all — real-world CSV is a zoo of broken quoting, stray delimiters and mixed line endings.
Nulls and empties deserve attention too. JSON has an explicit null; CSV has nothing — an empty cell is just an empty string, and distinguishing "no value" from "empty value" requires a policy. Similarly, JSON arrays and objects have no clean CSV representation, and the common compromises (dotted keys for objects, JSON-serialized text or index-prefixed columns for arrays) each lose something. The pragmatic approach is to decide per project: flatten objects (usually the right call), and either serialize arrays to JSON text or pivot them into a related table if the data truly is relational.
Why convert, and how to do it well
The typical conversion flows are well established. CSV to JSON dominates data migration and API work: a spreadsheet or database export feeds a web API, and the API consumes objects, not tables. JSON to CSV dominates reporting and analysis: an API response or a JSON log gets flattened into something a spreadsheet or BI tool can consume. In both directions the same best practices apply — treat the first row as the header (or generate column names if there isn't one), parse quotes and delimiters per RFC 4180 rather than splitting naively, and make type and null policies explicit instead of implicit.
For API integration specifically, JSON is the lingua franca: REST APIs speak JSON, and the moment data needs to travel between systems, JSON is the safest default because every platform's JSON parser agrees on the format in a way CSV parsers never have. CSV remains the right choice for the endpoints of a pipeline — human review, spreadsheet handoff, archival — where its readability and universal tool support beat JSON's structural fidelity. Knowing which format serves which end of your pipeline, and converting deliberately at the boundary, is most of the craft.
Frequently asked questions
How are quoted fields with commas handled?
The parser follows RFC 4180: fields wrapped in double quotes may contain commas, quotes (escaped as "") and even newlines.
What if my CSV has no header row?
Turn off 'First row is header' and the converter falls back to column1, column2 naming.
Does converting back to CSV preserve nested JSON?
Nested objects and arrays are flattened to dotted keys (e.g. address.city) so every value still fits a flat CSV column.