How to use the CSV to JSON
- 1
Paste or open CSV
Paste CSV or TSV text, copy cells from a spreadsheet, or open a .csv, .tsv or .txt file.
- 2
Check the delimiter
Auto-detect looks at the first five lines; force comma, semicolon, tab or pipe if it guesses wrong.
- 3
Choose types and shape
Decide whether to parse numbers, booleans and empty cells, and pick objects, arrays or columns.
- 4
Read the status, then copy
The status line shows rows, columns and the separator used. Copy or download converted.json.
Features
RFC 4180 quoting
Quoted fields may contain the delimiter, doubled quotes and line breaks.
Delimiter detection
Counts candidate separators in the first lines and picks the most frequent.
Type parsing
Plain integers and decimals become numbers, lower-case true/false become booleans, empty cells become null.
Leading zeros protected
Values like 007 or 09876543210 stay strings so IDs and phone numbers survive.
Three shapes
Array of objects, array of arrays, or an object of column arrays.
Header fallback
Blank header cells, or no header row at all, become column1, column2 and so on.
Who uses it — and for what
Developers
Turn a spreadsheet of products or users into seed data or test fixtures.
Chart builders
Feed CSV exports into charting libraries that expect JSON.
Shop owners
Prepare catalogue data from Excel for an API or a static site.
Students and researchers
Move survey exports into notebooks or JavaScript analysis.
Proper CSV parsing
CSV looks simple but has rules: fields containing commas, quotes or line breaks are wrapped in double quotes, and a quote inside a quoted field is written twice (""). This converter follows RFC 4180, so addresses with commas, multi-line notes and quoted text all come through correctly. Delimiter auto-detection handles comma, semicolon (common in Europe), tab (spreadsheet copy-paste) and pipe-separated files. You can paste straight from Excel or Google Sheets.
Output shapes
- Array of objects — one object per row keyed by the header; what most APIs and JavaScript code expect.
- Array of arrays — compact, keeps rows exactly, good for charts.
- Object of columns — each header maps to an array of its values, handy for data analysis.
With type parsing on, 42 becomes a number and true a boolean; leading zeros like 007 stay strings so IDs and phone numbers are preserved. Need the reverse? Use JSON to CSV.
Everything runs in your browser — your code and data are never uploaded, so it is safe to paste private config files and API responses.
Problems that come from the CSV, not the converter
- Wrong separator guessed. If the first lines contain more commas inside text than real separators, auto-detect can be fooled. Choose the delimiter manually.
- Duplicate header names. In an array of objects, two columns called
namebecome one key and the later column wins. Rename headers to be unique first. - Rows with extra cells. Cells beyond the header’s length are ignored in object and column output, often a sign of an unquoted comma in a value. Array-of-arrays output keeps them, which helps you find the faulty row.
- Short rows. Missing cells become empty values (null with type parsing on).
- Numbers with formatting. “₹1,299”, “12%” or “1.299,00” are kept as strings — strip currency symbols and thousands separators in the spreadsheet if you need numbers.
- Dates. JSON has no date type, so “2026-04-01” stays a string; convert it in your code.
Encoding matters too: open files saved as UTF-8 to keep names like “Ana López” or Hindi text intact. Excel’s “CSV UTF-8” save option does this.
Which output shape to use
| Shape | Looks like | Best for |
|---|---|---|
| Array of objects | [{"city":"Pune"}, …] | APIs, databases, JavaScript code that loops over records |
| Array of arrays | [["city"], ["Pune"]] | Compact storage, tables, charting libraries that take rows |
| Object of columns | {"city":["Pune", …]} | Charts with one series per column, quick statistics |
If the header option is off in array-of-arrays mode, the first line is kept as an ordinary data row. For the reverse trip use JSON to CSV; to look at a large file as a table first, open it in the CSV Viewer; and for .xlsx files go straight through Excel to JSON.
Worked examples
Types, quotes and a multi-line note
CSV:
pincode,city,phone,active,rating,notes
411001,Pune,09876543210,true,4.5,"Near station, gate 2"
560001,Bengaluru,+91 80 1234,FALSE,,"Line one
Line two"JSON with type parsing on (status: “2 rows · 6 columns · comma-separated”):
[
{
"pincode": 411001,
"city": "Pune",
"phone": "09876543210",
"active": true,
"rating": 4.5,
"notes": "Near station, gate 2"
},
{
"pincode": 560001,
"city": "Bengaluru",
"phone": "+91 80 1234",
"active": "FALSE",
"rating": null,
"notes": "Line one\nLine two"
}
]The phone number with a leading zero stays a string; FALSE in capitals is not recognised as a boolean; the empty rating becomes null; the quoted line break is kept as \n. With type parsing off, every value is a string and the empty rating is "".
What counts as a number
| Cell | JSON value |
|---|---|
-0.50 | -0.5 |
42 (spaces around) | 42 |
007 | "007" |
1e3 | "1e3" |
12345678901234567 | "12345678901234567" |
1,299 (quoted) | "1,299" |
Numbers of 16 or more characters stay strings, because JavaScript numbers lose precision beyond about 15–16 significant digits — that protects long account numbers and IDs.
Object of columns
name;marks / Asha;91 / Ravi;78 with “Object of columns” gives {"name": ["Asha", "Ravi"], "marks": [91, 78]} (shown here on one line; the tool indents it). The semicolon was detected automatically.
Pro tips
- Turn off type parsing when every column must stay text, for example product codes that look like numbers.
- Booleans are recognised only as lower-case true and false; TRUE, Yes or 1 stay as they are.
- Choose “Tab” indent or 4 spaces to match your project, or 2 spaces for smaller files.
Glossary
- Delimiter
- The character that separates fields in a row, such as a comma or tab.
- RFC 4180
- The document that describes the common CSV format, including quoting rules.
- Header row
- The first row of a CSV whose values name the columns.
Frequently asked questions
Can I paste from Excel?
Yes — copied cells are tab-separated, which auto-detect recognises.
What if my CSV has no header row?
Untick “First row is the header”; columns are named column1, column2…
Are large files supported?
Yes, tens of thousands of rows convert in a moment, all in your browser.
Why did my number become a string?
Numbers with a leading zero, exponent notation, thousands separators, currency symbols or 16+ characters are kept as strings to avoid changing or losing digits.
Does it trim spaces?
With type parsing on, values are trimmed before conversion. With it off, values are kept exactly, including spaces around them.
Can I nest fields like address.city?
No. Header names are used as flat keys, so a header called address.city becomes a key with a dot in it.
Last updated 2026-11-28 · Built by Vinayak Agarwal · Part of Developer & Web (77 tools)