Data

CSV ↔ JSON

Convert between CSV and JSON formats

Loading interactive tool…

Embed this tool on your site

About this tool

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. Paste comma-separated text with 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. The 'Detect numbers, booleans, and null' option turns numeric strings into real numbers, true and false into booleans and empty cells into null, while values with leading zeros such as 02139 stay strings. Uncheck it to keep every value as a string. The JSON → CSV button works in reverse: paste a JSON array of objects and receive 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 it

  • 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 used as object keys, so a CSV column named id becomes {"id": ...} without any manual mapping step. Header names are trimmed of surrounding spaces before they become keys.

  • Optional Type Detection: With the checkbox on, "42" and "3.14" become JSON numbers, true and false become booleans, and empty cells become null. Strings with leading zeros like 02139 stay strings. Uncheck it to keep every cell as a string.

  • Both Directions in One Tool: 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. Separate CSV → JSON and JSON → CSV buttons work on the same input box.

  • 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

  1. Paste your comma-separated text, including the header row, into the CSV or JSON box
  2. Leave 'Detect numbers, booleans, and null' checked for typed values, or uncheck it to keep every value as a string
  3. Click CSV → JSON to build an array of objects keyed by the header row
  4. To go the other way, paste a JSON array of objects and click JSON → CSV
  5. Copy the result, or click Download to save it as output.json or output.csv

When it helps

  • 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
Expected result · Scroll for more
[
  {
    "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"
Expected result · Scroll for more
[
  {
    "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}]
Expected result
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.
  • Values with leading zeros like ZIP code 02139 stay strings even with type detection on; uncheck it only if you also want numbers such as 42 to stay 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 always indented with 2 spaces; if you need it on one line, minify it before embedding it in code.
  • Save large outputs with the Download button rather than selecting and copying them by hand.

Frequently Asked Questions

How do I convert a CSV file to JSON without uploading it?
Open the file in a text editor or spreadsheet, copy its contents and paste them into the input box — there is no file picker. The parser runs in your browser using JavaScript, so your data never leaves your machine.
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 'Detect numbers, booleans, and null' checkbox. When it is on, "42" becomes 42, "3.14" becomes 3.14, true and false become booleans, and empty cells become null. Values with a leading zero, such as ZIP code 02139, stay strings either way. When it is off, every value stays a string.
Can I use semicolons or tabs as the delimiter instead of commas?
No. The parser splits on commas only, so a semicolon- or tab-separated file comes out as a single column. Convert tab-separated data to commas first (the CSV TSV Converter does this), or replace the semicolons before pasting.
How big a CSV can I paste before the browser slows down?
There is no fixed limit. The whole text is parsed in memory and the full result is written to the page, so pastes of several megabytes can make the tab sluggish. For very large files, split them first or use a command-line tool like jq.
How does it handle missing values and blank lines?
A row with fewer cells than the header gets empty strings for the missing columns, or null when type detection is on. Blank lines at the end of the input are dropped, but a blank line in the middle is not skipped: it becomes an object whose values are all empty (or null).
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. Paste a JSON array of objects into the input box and click JSON → CSV. The header row is the union of all object keys in the order they first appear. Nested objects are not flattened (they print as [object Object]), so keep values flat for clean output.

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.
A LITTLE HELP. A LOT DONE.
Good tools.
Great flow.

Your shortcut to the everyday. Create, convert, calculate,
and get back to what you love.

✓ Free to use✓ No sign-up✓ 500+ possibilities