CSV ↔ JSON Converter
Convert CSV to JSON and JSON to CSV. Custom delimiter, header detection, quoted fields, multi-line values, escaped quotes. Copy/download. 100% offline.
About this tool
A two-way CSV ↔ JSON converter that handles the messy real-world cases. The CSV parser supports four delimiters (comma, semicolon, tab, pipe), quoted fields with embedded delimiters, escaped double-quotes (""), and multi-line values that span rows. JSON output can be an array of objects (using the first row as header) or an array of arrays. The JSON → CSV direction accepts an array of objects (or arrays), collects all keys, escapes cells that contain commas, quotes, or newlines, and emits a clean CSV with an auto-generated header. Both directions copy to clipboard and download as a file (.json or .csv). A Swap button moves the output to the input and flips the direction for round-trip testing. 100% offline, no CDN.
Details
- Category
- developer
- Version
- 1.0.0
- Size
- 14 KB
- Updated
- Jun 2026
Frequently Asked Questions
How does the CSV parser handle quoted fields?
Quoted fields start with a double-quote (") and end at the next unescaped double-quote. Inside a quoted field, the delimiter and newline are treated as literal characters (not separators). To include a literal double-quote inside a quoted field, double it ("") — that is the CSV standard. So a cell with the value He said "hi" looks like "He said ""hi""" in CSV. The parser handles this correctly; the value He said "hi" is what you get back in JSON.
What is the difference between array-of-objects and array-of-arrays output?
Array of objects uses the first row as a header and produces one object per data row, with the header values as keys. This is the most common JSON representation for tabular data and matches what most APIs and downstream tools expect. Array of arrays emits every row (including the header) as a positional array. This preserves the exact row order with no key collisions and is useful when the header row contains duplicates, or when you want positional access. Toggle the option in the JSON output settings to switch.
Why does the tool use a custom CSV parser instead of a library?
To keep the tool fully offline and zero-dependency. The standard library CSV parsers (PapaParse, csv-parse) are excellent but require either a CDN script or a build step. The in-house parser handles the 95% case (quoted fields, escaped quotes, multi-line values, custom delimiter, header detection) in about 60 lines of JS. It does not handle every edge of RFC 4180 (e.g. CR-only line endings, BOM handling beyond standard UTF-8) but it covers what real CSV files in the wild actually use.
What does the Swap button do?
Swap moves the Output text into the Input field and flips the conversion direction in one click. This is the standard "round-trip" workflow: paste CSV in, convert to JSON, swap, convert back to JSON-as-CSV. If the two CSV outputs (modulo formatting and the object-to-array transformation) are identical, the round-trip is lossless. If they differ, you have found a CSV feature the parser does not preserve (e.g. a leading space inside a quoted field that the second pass trim-clipped).
Is my data private?
Yes. Both the CSV parser and the JSON serializer are pure JavaScript inlined in the HTML. There are no network calls and no CDN dependencies. Files are read by the browser FileReader API and stay on your device. You can convert internal CSV exports containing customer or financial data without worry.