CSV ↔ JSON Converter
Convert CSV data to JSON arrays/objects and JSON arrays back to CSV. First row used as headers. Supports custom delimiters.
What This Converter Never Sees
CSV exports frequently contain more sensitive data than the person converting them realizes — customer records, internal account numbers, or a spreadsheet dump that includes a column of API keys someone meant to strip out before sharing. Because this tool runs entirely in JavaScript inside your browser tab, nothing you paste into it is ever transmitted to a server: there is no upload step, no backend processing, and no log of what was converted. That's a meaningful property for anyone converting data that shouldn't leave a laptop or a corporate network, though it's still worth being deliberate about which browser extensions are installed, since an overly permissive extension could in principle read page content that a server-side tool would never have been exposed to in the first place.
The more common real risk isn't the tool — it's what happens to the output afterward. A JSON array generated here and then pasted into a chat message, a support ticket, or a public code-sharing gist carries whatever sensitive fields were in the original CSV, now in a format that's easier for automated scanners to parse and exfiltrate. Treat the converted output with the same handling rules as the source spreadsheet, not as a fresh, lower-sensitivity artifact just because its format changed.
The jq and Miller Equivalent
For one-off interactive conversions, this page is faster than reaching for a terminal, but the same transformation is a one-liner in most Unix shells once it needs to be repeated or scripted. Miller (mlr), a tool built specifically for tabular formats, handles the conversion directly: mlr --icsv --ojson cat data.csv converts CSV to JSON with the same header-as-keys behavior this tool implements, and mlr --ijson --ocsv cat data.json reverses it. Python's standard library offers an equally direct route with no external dependencies: python3 -c "import csv,json,sys; print(json.dumps(list(csv.DictReader(sys.stdin))))" performs the CSV-to-JSON half of what this page does, reading each row into a dictionary keyed by header exactly as the browser tool does.
Slotting Conversion Into a Pipeline
Data pipelines routinely need this exact conversion at a specific step — pulling a CSV export from a legacy reporting system and turning it into JSON for an ingestion API, or converting a JSON array returned by a monitoring endpoint into CSV for a scheduled report. In a CI or scheduled-job context, that conversion is typically done with mlr or a small Python or Node script rather than a browser tool, but the logic is identical: the first row (or first object's keys) becomes the schema, type detection decides numbers versus strings versus booleans, and delimiter handling accounts for values containing commas or quotes per RFC 4180. Prototyping the expected transformation here first — pasting in a sample of the real data and confirming the output looks right — is a fast way to validate the shape of a conversion step before writing it into a pipeline script that will run unattended on a schedule.
Parsing Rows Into Structured Objects
For CSV to JSON, the first row is treated as the set of property names, and each subsequent row becomes one JSON object where each column maps to its corresponding header key. Values are trimmed of surrounding whitespace and quotes, then type-detected: a value that parses cleanly as a number becomes a JSON number, the literal strings "true" and "false" become JSON booleans, and everything else stays a string. For JSON to CSV, the reverse process reads the keys of the first object in the array as column headers, then writes one row per object; any value containing the active delimiter, a quote character, or a newline is automatically wrapped in double quotes with internal quotes escaped, matching the quoting rules defined in RFC 4180 so the output opens correctly in any spreadsheet application.
Frequently Asked Questions
How does CSV to JSON conversion work?
The first row of the CSV is used as the property names for each JSON object. Each subsequent row becomes one JSON object with those properties as keys and the row values as values. The tool trims whitespace from headers and values, strips surrounding quotes, and auto-detects data types — so a column containing numbers will produce JSON number values rather than strings. The output is a JSON array where each element represents one row of the CSV input.
How do I convert JSON back to CSV?
Select the JSON to CSV direction and paste a JSON array of objects. Each object in the array becomes one CSV row, and the keys of the first object are used as the column headers. You can choose a custom delimiter — comma, semicolon, tab, or pipe — to match the requirements of your target spreadsheet application or database import tool. Values containing the chosen delimiter are automatically double-quoted and escaped.
Does the converter preserve data types when converting CSV to JSON?
Yes. The converter auto-detects and preserves common data types: numeric strings like "42" or "3.14" become JSON numbers, and the literal strings "true" and "false" become JSON booleans. All other values remain JSON strings. This is important for downstream consumers like JavaScript code or JSON Schema validators that distinguish between "42" (a string) and 42 (a number). If you need all values to remain strings regardless of content, wrap them in double quotes in your CSV to force string interpretation.