Need to convert CSV to JSON (or JSON back to CSV) without writing Python or JavaScript? CSV and JSON are the two most common data exchange formats — CSV for spreadsheets and Excel exports, JSON for APIs and web apps — and switching between them is a daily task. The quickest method requires no code: paste your data into a converter, choose a few options, and download the result.
This step-by-step guide shows how to convert CSV to JSON and JSON to CSV online, explains the key options (delimiters, headers, nested objects, type handling), and covers the common errors that break conversions so the output is ready to use.
What Is CSV and What Is JSON?
Both store tabular data, but their structure and strengths differ. Understanding the difference prevents conversion mistakes.
CSV (Comma-Separated Values)
CSV is a plain-text table: each line is a row, commas (or another delimiter) separate columns, and the first row often holds headers. Defined in RFC 4180, it is compact and opens directly in Excel, Google Sheets, and databases. It does not support nesting or data types — everything is text, and commas inside fields must be quoted: "New York, NY".
JSON (JavaScript Object Notation)
JSON, defined in RFC 8259, stores data as objects and arrays with typed values. A CSV table becomes an array of objects where headers become keys. JSON supports nesting ({"address":{"city":"Berlin"}}), arrays ("tags":["vip","eu"]), numbers, booleans, and null — making it ideal for APIs and web apps (MDN: JSON). The trade-off is size: JSON is ~1.5× larger than CSV for flat tables because keys repeat on every row.
| Aspect | CSV | JSON |
|---|---|---|
| Structure | Flat rows + columns | Objects, arrays, nesting |
| Types | All strings | String, number, boolean, null |
| Headers | First row (optional) | Keys per object |
| Best for | Spreadsheets, imports, bulk data | APIs, configs, web apps |
How to Convert CSV to JSON Without Writing Code (Step-by-Step)
Answer-first: paste CSV, confirm delimiter and headers, copy JSON. The preview updates live so errors are caught before downloading.
Step 1: Paste or Drop Your CSV
Copy from Excel, Google Sheets, or a .csv file and paste directly. The converter handles UTF-8, quoted fields containing commas ("book,pen"), line breaks inside quotes, and large files (100k+ rows). No upload is required — processing stays in the browser.
Step 2: Choose Delimiter, Headers, and Output Shape
- Delimiter: Comma (
,) is standard (RFC 4180), but European Excel often exports with semicolon (;) due to decimal commas. Use auto-detect or select;,|, or Tab for TSV. - Headers: Leave "First row is header" checked if row 1 contains column names — they become JSON keys. Uncheck if the file has no headers; keys default to
col1, col2…or custom names. - Output: "Array of objects" (
[{"name":"Anna"},...]) is standard for APIs. "NDJSON" (one JSON per line) suits streaming and log processing.
Step 3: Copy or Download JSON
The JSON preview appears instantly. Verify that numbers remain numbers (49.99 not "49.99") and quoted commas stayed intact, then copy or download .json. Prettified output with 2-space indent is ready for APIs and databases.
How to Convert JSON to CSV Without Writing Code
The reverse is equally common — turning an API response into a spreadsheet.
- Paste a JSON array such as
[{"name":"Anna","age":28},...]. The converter also accepts NDJSON and single objects. - Handle nesting: For nested objects like
{"address":{"city":"Berlin"}}, choose "Flatten" to create dotted columns (address.city) for Excel, or keep as a JSON string in one cell for fidelity. - Download CSV: Headers are generated from keys, delimiter is selectable (use
;for EU Excel), and unmatched keys become empty cells.
Tip: If the JSON has inconsistent keys across objects, flattened CSV will include all keys as columns — empty where a row lacks that field.
Key Options Explained (So the Output Is Correct)
Delimiter and Quoting
RFC 4180 specifies that fields containing a delimiter, quote, or line break must be enclosed in double quotes, with inner quotes escaped as "": "He said ""hi""". A good converter implements this automatically. If CSV looks broken in Excel, the delimiter is likely wrong — switch between comma and semicolon.
Headers vs Data
When "First row is header" is on, row 1 becomes keys. Turning it off treats row 1 as data and generates keys col1, col2. For JSON→CSV, headers derive from object keys; custom header order can be specified to control column sequence.
Nesting (JSON → CSV)
CSV has no native nesting. Two strategies:
- Flatten:
{"user":{"name":"Anna"}}→ columnsuser.name, user.age— readable in Sheets - Stringify: nested value stored as
"{\"name\":\"Anna\"}"in one cell — preserves structure for re-import
Types and Empty Values
CSV cells are strings; conversion can infer types: "28" → 28 (number), "true" → true (boolean), "" → null or "" per setting. Disable inference to keep everything as strings and avoid accidental coercion (e.g., ZIP codes "00123" should stay string).
Before and After — Real Examples
Example 1: E-commerce Orders (CSV → JSON for API)
CSV:
order_id,customer,total,items
1001,Anna,49.99,"book,pen"
1002,Ben,12.50,notebook
→ JSON:
[
{"order_id": 1001, "customer": "Anna", "total": 49.99, "items": "book,pen"},
{"order_id": 1002, "customer": "Ben", "total": 12.50, "items": "notebook"}
]
Note: "book,pen" stayed as one field due to quoting; numbers are numeric in JSON.
Example 2: API Response (JSON → CSV for Excel)
JSON:
[{"name":"Anna","address":{"city":"Berlin"}},{"name":"Ben","address":{"city":"Paris"}}]
→ CSV (flattened):
name,address.city
Anna,Berlin
Ben,Paris
Other Methods (Why Online Is Faster)
- Excel/Sheets: Open CSV natively; JSON requires Power Query (Excel) or Apps Script (Sheets) and extra clicks, with no nested handling.
- Code: Python
csv.DictReader→json.dumpand JSPapaParsework but need setup and dependency management. - Online converter: Zero setup, handles delimiters, nesting, and types with live preview and browser-side privacy — data never leaves the device, suitable for sensitive exports.
Common Errors and How to Fix Them
- "Unexpected token" JSON error: Trailing comma or single quotes — JSON requires double quotes (
"key"not'key'). - CSV broken in Excel: Delimiter mismatch — choose semicolon for EU locales or Tab for TSV.
- Missing/extra columns: Uneven rows — missing cells become empty; verify header toggle and delimiter.
- [object Object] in CSV: Nested object not flattened — select "Flatten (a.b)" instead of default.
FAQs About Converting CSV to JSON
How do I convert CSV to JSON without code?
Paste CSV into a CSV to JSON converter, confirm the delimiter and header setting, and copy the JSON array. No installation is needed and files up to 100k+ rows process in the browser.
How do I convert JSON back to CSV?
Paste a JSON array of objects, choose how to handle nested fields (flatten to address.city or keep as JSON string), select a delimiter, and download CSV for Excel or Sheets.
Does converting CSV to JSON preserve numbers and booleans?
By default, many converters infer types: "28" becomes 28 and "true" becomes true. Disable inference to keep all values as strings when fidelity matters (e.g., IDs with leading zeros).
What delimiter should I use for CSV?
Comma (,) per RFC 4180 is standard. Use semicolon (;) for Excel in locales where comma is the decimal separator, and Tab for TSV. Auto-detect picks the delimiter present in the file.
How do I handle nested objects when converting JSON to CSV?
CSV has no nesting. Either flatten with dotted keys (user.name → separate columns) for spreadsheet use, or stringify the nested object into one cell to preserve structure for re-import.
Is it safe to convert sensitive CSV/JSON online?
When conversion runs entirely in the browser, data never leaves the device or touches a server, unlike server-side tools. This is preferable for customer lists or financial data — verify the tool processes locally and requires no upload.
Conclusion
Converting CSV to JSON (and back) without code is a matter of choosing the right delimiter, header, and nesting options. Once those are set, paste, preview, and download produces clean, typed output ready for APIs or spreadsheets.
For a quick, private conversion with live preview and support for large files, paste the data into the free online converter and download the result — no setup, no spreadsheet formulas, no scripts.