The Two-Way CSV to JSON Converter Guide: Typed Values, Nested Data, and the Delimiter Trap
A spreadsheet export a developer needs as an array. An API response a manager wants as a table. A European Excel file full of semicolons. Same job, different directions. This guide shows how to turn CSV to JSON and JSON to CSV with the free CSV to JSON converter above, exactly which values become numbers and which stay text, what happens to nested objects, and where the tool stops.

1. CSV to JSON and JSON to CSV: What Each Direction Gives You
CSV is a table written as text: one line per row, values separated by a delimiter, usually with a header line naming the columns. Its rules are loosely written down in RFC 4180. JSON, defined in RFC 8259, is what code and APIs speak, with real numbers, booleans and nesting.
CSV → JSON
The first row is the header; every later row becomes one object keyed by those names, in a JSON array saved as data.json.
JSON → CSV
Each object becomes a row, every key becomes a column, and nested values flatten into readable column names, saved as data.csv.
People look for a CSV JSON converter two way so the data can go back without a second site; here both directions sit behind the Conversion menu. What it does not do: read or write Excel workbooks, parse JSON Lines, rebuild nesting from dotted headers, or filter and sort rows. Where another Cortexis tool does the job, it is named below; where none does, the guide says so.
2. How to Convert CSV to JSON in Four Steps
Here is how to convert CSV to JSON, with no account.
- Add your data. Drop a .csv, .tsv or .txt file, or paste rows into the text box over the sample.
- Pick CSV → JSON. Leave Delimiter on Auto-detect; it tries comma, semicolon, tab and pipe and picks the most consistent.
- Set typing and layout. Keep Convert numbers/booleans on for typed values. Keep Pretty-print JSON on for two-space indentation, or turn it off to minify JSON from CSV into a single compact line.
- Convert, then copy or download. Press Convert. A note shows the record and column count.
That is how you convert CSV to JSON array of objects form for front-end code, fixtures or a mock endpoint. Quoting is handled properly, so a CSV with commas in fields to JSON converts cleanly: “12 Mall Road, Lahore” stays one value, doubled quotes become one, and line breaks inside quoted cells are kept. A leading byte order mark is removed so the first key stays clean.
3. How to Convert JSON to CSV, Nested Data Included
For how to convert JSON to CSV, paste the JSON or drop a .json file, switch to JSON → CSV and press Convert. The JSON to CSV converter accepts three shapes:
- A JSON array to CSV. A top-level array of objects gives one row per object. An array of plain values becomes a single column named value.
- API response JSON to CSV. When the list is wrapped, as in
{"data": [...]}, the first array of objects inside is used, so no hand-trimming. - A single object. Anything else becomes one row.
Nested JSON to CSV is where most converters get vague. With Flatten nested objects on (the default), the tool will flatten JSON to CSV using dot-path column names: {"address": {"city": "Karachi"}} becomes a column called address.city, and {"tags": ["new", "vip"]} becomes tags.0 and tags.1. Turn flattening off and each nested value is kept as a JSON string in one cell.
The header collects every key across all records in first-seen order, so a missing field leaves a blank cell rather than shifting columns. Values containing the delimiter, quotes or line breaks, or starting or ending with a space, are quoted. Lines end with a plain line feed.
What JSON → CSV does not do: it will not explode a nested array into extra rows (one order with three items stays one row, with columns such as items.0.sku and items.1.sku), and it has no way to pick, sort or filter columns and rows. For that kind of reshaping, open the CSV in a spreadsheet afterwards. It also converts one file per press of Convert, so batches are done one at a time.
Getting an invalid JSON error when converting to CSV? The input must be one complete JSON document. Usual culprits: a trailing comma, single quotes, a partial copy, or JSON Lines (one object per line), which this tool does not read. To find the broken spot, use the JSON formatter.
4. CSV to JSON: Keep Leading Zeros, Type Numbers and Booleans
Everything in CSV is text, so a converter must decide what becomes a number. Guess too eagerly and ZIP codes lose digits. The exact rules with Convert numbers/booleans on:
- Plain numbers such as 29 or 3.75 become JSON numbers, provided they are shorter than 16 characters.
- true, false, TRUE and FALSE become booleans; null and NULL become null.
- Values with leading zeros, such as 007 or 04210, stay strings, which is the whole answer to CSV to JSON keep leading zeros: no extra step.
- Long digit strings of 16 characters or more stay strings, so IDs are never silently rounded.
- Empty cells become an empty string.
Want CSV to JSON numbers as strings everywhere? Untick the option and every value comes through exactly as written.
5. Semicolons, Tabs and the CSV That Opens in One Column
In many European locales Excel saves CSV with semicolons, because the comma is the decimal separator. Auto-detect handles semicolon CSV to JSON untouched, and TSV to JSON too: rows copied from a spreadsheet are tab-separated and paste straight in. If detection guesses wrong, pick the delimiter by hand.
The reverse symptom, searched as “CSV opens in one column Excel”, is a delimiter mismatch. Going JSON → CSV, the Delimiter menu sets the output separator (Auto-detect means comma). Choose Semicolon for JSON to CSV with semicolon delimiter output that opens in columns under a European locale.
6. JSON to Excel, Google Sheets, and Excel to JSON
How to open JSON file in Excel: convert it to CSV here, then open the CSV. That is the practical route for JSON to Excel. The CSV has no byte order mark, so double-clicking can garble accented letters; import it through Excel’s Data tab with UTF-8 selected, or make a real workbook with the spreadsheet converter, which handles XLSX and ODS.
For JSON to CSV Google Sheets imports, download data.csv and use File → Import.
And how to convert Excel to JSON: save the sheet as CSV, then run it through CSV → JSON. Row one is always the header; blank header cells become col1, col2, and a duplicate name overwrites the earlier column, so rename duplicates first. Output is always a flat array; dotted headers stay literal key names.
Working with other formats? XML goes through the XML to JSON converter, YAML through the YAML to JSON converter, and SQL INSERT statements through the SQL to CSV tool.
7. Why Use the Cortexis CSV to JSON Converter
Plenty of pages offer JSON to CSV online. Few say what they do to your data. Here is ours.
Two directions, one page
CSV to JSON and JSON to CSV share one panel. Switch the Conversion menu and convert again.
Typing rules you can predict
Numbers, booleans and nulls are typed; leading zeros and 16+ character IDs stay strings; one checkbox keeps everything as text.
Nested data made readable
Nested objects and arrays flatten to columns like address.city and tags.0, or stay as JSON strings.
Real CSV quoting
Commas, quotes and line breaks inside cells are handled, and semicolon, tab and pipe files are recognised.
Your data stays private
Files are never stored on our servers and nothing is retained after your session.
Never used for training
What you convert is never fed into training data. Free to use, with no sign-up.
It sits alongside a wider set of free data and file tools built on the same terms. To compare two exports, use the diff checker.
8. Frequently Asked Questions (FAQ)
Is this CSV to JSON converter free?
Yes. It is CSV to JSON online free, with no account needed. Paste or drop your CSV, press Convert, then copy or download data.json.
Why did my ZIP codes or IDs lose their leading zeros elsewhere, and will they here?
Many converters turn anything numeric-looking into a number, dropping leading zeros. Here, values starting with a zero followed by more digits stay strings, as do digit strings of 16 characters or more. To keep every value as text, untick Convert numbers/booleans.
How do I turn nested JSON into CSV columns?
Choose JSON to CSV and leave Flatten nested objects on. A nested object becomes dot-path columns such as address.city, and an array becomes indexed columns such as tags.0 and tags.1. Arrays are not expanded into extra rows.
Why does it say Invalid JSON?
The input must be one complete, valid JSON document, and the message includes the parser reason. Trailing commas, single quotes, truncated copies and JSON Lines files are the usual causes. The JSON formatter helps you find the exact spot.
Can it convert my API response JSON to CSV if the list is inside a data key?
Yes. If the top level is an object that wraps an array of objects, such as a data or results key, the first such array is used automatically. Other top-level objects become a single row.
How do I use CSV to JSON output in React, Node or TypeScript code?
The download is a standard JSON array of objects, one per row, keyed by your header names. Save data.json into your project and import it, or paste the copied text into JSON.parse. Turn off Pretty-print JSON for a single compact line that is easy to drop into a fixture or mock response.
Can I get an Excel XLSX file directly?
Not from this tool, which outputs plain CSV. Import that CSV through the Excel Data tab with UTF-8 chosen, or convert it to XLSX with the spreadsheet converter.
My CSV has no header row. What happens?
The first row is always read as the column names, so your first record would become the keys. Add a header line before converting. Also rename any duplicate column names, because a later column with the same name overwrites the earlier one.
Is it safe to convert customer or financial data?
Your files are never stored on our servers, nothing is retained after your session, and nothing is used for training. You can also paste only the columns you need.
Converted and ready for the next step? Tidy the JSON with the JSON formatter, encode a payload with the Base64 encoder and decoder, turn a report into a shareable document with the XLSX to PDF converter, or pull a table out of a PDF with the PDF to Excel converter. And if you would rather write conversions like this yourself, our free Python development course and full-stack web development course both cover the data-handling groundwork behind tools like this one.

