UtilityKit

500+ fast, free tools. Most run in your browser only; Image & PDF tools upload files to the backend when you run them.

CSV ↔ JSON

Convert between CSV and JSON formats

About CSV ↔ JSON

Spreadsheet rows and JSON arrays describe the same data — this converter turns one into the other in your browser without a custom parser or uploading to a third-party server. It handles the RFC 4180 edge cases that a naive comma-split breaks on: quoted commas, escaped double-quote pairs, and multi-line cell values. Drop in a header row and each column name becomes a JSON key, giving you an array of objects ready for an API, MongoDB, or a Python script. Optional type coercion turns numeric strings into real numbers and boolean strings into true or false — or keep everything as strings for IDs with leading zeros. Conversion works in reverse too: paste a JSON array of objects and receive a clean CSV with a union-of-keys header row. Because the parser runs in JavaScript inside your tab, customer emails, internal SKUs, and PII never leave your machine.

Why use CSV ↔ JSON

RFC 4180 Quote-Aware Parser

Handles edge cases that break naive split(',') implementations: quoted fields containing commas, escaped double-quote pairs written as """, and multi-line cell values wrapped in quotes. Your Salesforce and HubSpot exports parse correctly every time.

First Row Becomes JSON Keys

The header row is auto-detected and used as object keys, so a CSV column named id becomes {"id": ...} without any manual mapping step. Remove or rename headers in the source and the JSON keys update instantly in the live preview.

Auto Type Coercion (Optional)

Numeric strings like "42" and "3.14" can be cast to real JSON numbers, and "true" or "false" become booleans. Toggle it off for Stripe-style numeric IDs or ZIP codes with leading zeros that must stay as strings.

Bidirectional in One Pane

A JSON array of objects converts back to CSV using a union-of-keys header, so round-tripping data through a spreadsheet takes one paste each way. The swap button flips direction without losing what you already typed.

Works on 50,000-Row Files

The streaming-style JavaScript parser handles a 5 MB CSV in under a second on a modern browser with no server round-trip, no upload progress bar, and no file-size paywall. Paste large Mixpanel or GA4 exports and get results immediately.

Zero Upload, Zero Logs

Customer emails, internal SKUs, financial figures, and any PII never leave your browser tab. The JS parser runs entirely in memory — no fetch request is made and no server ever sees your data.

How to use CSV ↔ JSON

  1. Paste your CSV text (including the header row) into the left panel, or drop a .csv file onto the upload area
  2. Confirm or change the detected delimiter — the tool auto-detects comma, semicolon, tab, or pipe but you can override it
  3. Toggle type coercion on or off to control whether "42" becomes the number 42 or stays the string "42"
  4. Watch the JSON array render live in the right panel as you type or adjust settings
  5. Use the swap button to reverse direction (JSON → CSV) without clearing the current content
  6. Copy the result to clipboard or download as a .json or .csv file

When to use CSV ↔ JSON

  • Converting a Stripe, Salesforce, or Excel CSV export into a JSON array to feed into an API or database import script
  • Wiring a CSV dataset into a JavaScript or Python prototype without writing a custom parser
  • Transforming a Mixpanel or Google Analytics export into JSON for further processing in Node.js or pandas
  • Roundtripping data through a spreadsheet: exporting JSON from an API, editing it in Excel, then reimporting as JSON
  • Validating that a CSV file from a third-party vendor parses cleanly before loading it into a data pipeline
  • Quickly inspecting the shape of an unfamiliar CSV by seeing the keys and types in the JSON preview

Examples

Basic CSV → JSON

Input: id,name,email,active 1,Ada Lovelace,ada@example.com,true 2,Alan Turing,alan@example.com,false

Output: [ {"id":1,"name":"Ada Lovelace","email":"ada@example.com","active":true}, {"id":2,"name":"Alan Turing","email":"alan@example.com","active":false} ]

Quoted commas and apostrophes

Input: company,city,note "Acme, Inc.","New York","O'Brien said ""hi""" Globex,Springfield,"Multi line"

Output: [ {"company":"Acme, Inc.","city":"New York","note":"O'Brien said \"hi\""}, {"company":"Globex","city":"Springfield","note":"Multi\nline"} ]

JSON → CSV (reverse)

Input: [{"sku":"A-1","qty":3,"price":19.99},{"sku":"B-2","qty":1,"price":4.50}]

Output: sku,qty,price A-1,3,19.99 B-2,1,4.5

Tips

  • If your CSV opens with sep=, in the first row (an Excel artifact), delete that line before pasting — it is a hint to Excel, not actual data.
  • For numeric IDs that start with a leading zero (like ZIP code 02139), turn off auto-type-coercion so they stay as strings.
  • If columns get shifted after a paste, your CSV likely has an unescaped quote — find the row count discrepancy and add the missing closing quote.
  • JSON output is minified by default for copy-paste; use pretty-print with 2-space indent only when sharing in docs or chat.
  • Save large outputs as a .json file rather than copying — the clipboard truncates silently around 1 MB on some browsers.

Frequently Asked Questions

How do I convert a CSV file to JSON without uploading it?
Paste the CSV text directly into the left panel — no file upload is needed. The parser runs in your browser using JavaScript, so your data never leaves your machine. If you prefer to drop a file, use the file-drop area and the same local parser handles it.
Does the converter handle commas inside quoted strings correctly?
Yes. Fields wrapped in double quotes are parsed as a single value even if they contain commas, newlines, or escaped double-quote pairs (written as ""). This follows the RFC 4180 standard that tools like Excel and Google Sheets use when exporting.
Will numbers in my CSV become real numbers in JSON or stay as strings?
It depends on the type-coercion toggle. When coercion is on, "42" becomes 42 and "3.14" becomes 3.14. When it is off, every value stays a string — useful for ZIP codes, phone numbers, or Stripe IDs that must not lose leading zeros.
Can I use semicolons or tabs as the delimiter instead of commas?
Yes. The tool auto-detects the delimiter and shows the detected choice, but you can manually select comma, semicolon, tab, or pipe. European Excel exports often use semicolons; TSV files from databases use tabs.
How big a CSV file can I paste before the browser slows down?
Files up to about 5 MB (roughly 50,000 rows at typical widths) parse in under one second on a modern browser. Beyond that, pasting into the textarea itself can lag. For very large files, paste in sections or use a command-line tool like jq.
How does it handle missing values, blank lines and trailing commas?
Missing values produce an empty string or null in the JSON object, depending on the coercion setting. Blank lines are skipped. A trailing comma on the last row is treated as an extra empty field, which usually means your CSV has an off-spec trailing delimiter — remove it for clean output.
Will it preserve the original column order in the output?
Yes. JSON objects in the output preserve the column order from the header row. When converting JSON back to CSV, the header row uses the union of all keys in the order they first appear across all objects.
Can I convert the resulting JSON back to CSV in the same tool?
Yes. Use the swap button or paste a JSON array of objects into the left panel when it is set to JSON → CSV mode. The tool derives the header row from the union of all object keys and writes each object as a data row.

Explore the category

Glossary

RFC 4180
The informal standard that defines how CSV files are structured, including quoting rules for fields that contain commas, newlines, or double-quote characters. Most spreadsheet programs follow this when exporting.
Header row
The first row of a CSV file that names each column. When converting to JSON, header row values become the keys in each output object.
Delimiter
The character used to separate fields in each row. Commas are most common, but semicolons, tabs, and pipes are also widely used depending on locale and tool.
Quoted field
A CSV field wrapped in double quotes, allowing it to contain the delimiter character, newlines, or literal double-quote characters without breaking the row structure.
Escape character
In CSV, a double-quote inside a quoted field is escaped by doubling it ("" represents one literal "). This differs from most programming languages, which use a backslash as the escape character.
Type coercion
The process of converting a string value to a more specific data type — for example, turning the string "42" into the number 42 or "true" into a boolean. Optional in CSV-to-JSON conversion.