CSV to JSON Converter
Two-way CSV ⇄ JSON with delimiter detection, safe typing and a preview table.
Paste data, drop a file on this box, or use Open file. Files are read on your device and never uploaded.
Preview
About the CSV to JSON Converter
Turn a spreadsheet export into JSON for an API, a script or a database — or flatten a JSON API response into a CSV file you can open in Excel or Google Sheets. The converter detects the delimiter (comma, semicolon, tab or pipe), understands quoted values that contain commas and line breaks, and shows the first 100 rows in a preview table.
The conversion runs in a background thread on your device, so files with tens of thousands of rows convert without freezing the page, and nothing is uploaded. Number typing never loses information: codes with leading zeros such as 007 or the STD code 0484, phone numbers such as +919876543210 and long IDs stay exactly as written.
How to use it
- Choose CSV → JSON or JSON → CSV.
- Paste your data, drop a file onto the input box, or use Open file (
.csv,.tsvor.json). The direction switches automatically for JSON files. - Adjust the options — header row, value typing and nesting for CSV; delimiter, line endings and quoting for JSON. The result updates as you type.
- Check the preview, then Copy or Download the result. For Excel, tick UTF-8 BOM so accented letters and Indian scripts display correctly when the file is opened.
Examples
name,age,city Asha,31,Pune "Rao, Vikram",45,Hyderabad
[
{
"name": "Asha",
"age": 31,
"city": "Pune"
},
{
"name": "Rao, Vikram",
"age": 45,
"city": "Hyderabad"
}
]The quotes around "Rao, Vikram" keep the comma inside the value; 31 and 45 become numbers.
[{"id":1,"address":{"city":"Pune","pin":"411001"},"tags":["a","b"]},
{"id":2,"address":{"city":"Delhi"}}]id,address.city,address.pin,tags 1,Pune,411001,"[""a"",""b""]" 2,Delhi,,
Nested objects become dot-path columns and arrays are kept as JSON text. Missing fields are left empty.
Common uses
- Preparing seed data or test fixtures for an app from a spreadsheet.
- Opening an API response or a database export in Excel or Google Sheets.
- Converting semicolon-separated exports from European Excel versions or tab-separated reports.
- Checking a CSV file for unclosed quotes or rows with missing columns before importing it.
How CSV is read
The converter follows the common CSV rules described in RFC 4180: values are separated by the delimiter; a value that contains the delimiter, a double quote or a line break is wrapped in double quotes; and a double quote inside such a value is written twice ("").
A UTF-8 byte-order mark at the start of the file is removed. An unclosed quote or text after a closing quote stops the conversion with the exact line and column, and rows with more or fewer values than the header are listed so you can fix them.
How values are typed
With Convert numbers, true/false and empty cells on:
- Numbers become JSON numbers only when nothing is lost: no leading zeros (
007stays text), at most 15 significant digits, and whole numbers within ±9,007,199,254,740,991. trueandfalse(in any of the forms true, TRUE or True) become booleans.- Empty cells become
null. - Everything else stays text, including
+91…phone numbers and values like1,234.
Turn the option off to keep every value as text exactly as it appears in the file.
How JSON becomes CSV
- The columns are every key found in the objects, in the order they first appear.
- Nested objects become dot-path columns such as
address.city(or stay as JSON text if you turn flattening off). Arrays are written as JSON text in a single cell. nullbecomes an empty cell, and numbers are written exactly as in the JSON — even 20-digit IDs.- A response wrapped in an object, such as
{"data": [ … ]}or{"count": 2, "results": [ … ]}, is unwrapped automatically when it holds exactly one array of objects. Wrap an object in[ ]to convert it as a single row instead. - Protect against spreadsheet formulas puts an apostrophe before values that start with
=,+,-or@(plain numbers are left alone), a defence against CSV injection when the file is opened in a spreadsheet.
Limitations
- Files are limited by your device's memory. Files up to 200 MB can be opened; files over 1 MB are converted without being shown in the editor.
- The output box shows the first 400 KB of a large result; Copy and Download always include everything.
- Excel workbooks (
.xlsx) cannot be read directly — save the sheet as CSV first. - JSON must be standard JSON: comments, trailing commas and single quotes are reported as errors.
Privacy
Everything happens in your browser. What you enter or open here is not uploaded or stored by MySmartCoPilot.
Frequently asked questions
Does it handle commas and line breaks inside values?
Yes, as long as those values are wrapped in double quotes, which is what Excel, Google Sheets and most databases write. When converting JSON to CSV, values that need quotes get them automatically.
My file uses semicolons instead of commas. Is that a problem?
No. Excel in many European locales saves CSV with semicolons; the delimiter is detected automatically. You can also choose comma, semicolon, tab or pipe yourself.
Why are some numbers kept as text?
Because converting them would change them. 0484 would lose its leading zero and 12345678901234567890 is too long for a JSON number to hold exactly in JavaScript. Keeping them as text preserves your data. (Ordinary numbers are converted by value, so 1499.50 becomes 1499.5.)
How do I open the CSV in Excel without garbled characters?
Tick UTF-8 BOM for Excel before downloading. The invisible marker tells Excel the file is UTF-8, so names like “Müller” or “प्रिया” display correctly. Google Sheets and most other tools do not need it.
How large a file can it convert?
Tens of thousands of rows convert in well under a second on a typical laptop. Larger files work too; the limit is the memory available to your browser.
Is my data uploaded anywhere?
No. Files are read and converted on your device, in a background thread of this page. Nothing is sent to a server.