Output will appear here
Output will appear here
Paste CSV with a header row and get a JSON array with one object per row. Header names become keys. Cells that look like numbers, true/false or null are converted to those JSON types, but values with a leading zero such as 02134 stay strings. Quoted fields may contain delimiters, doubled quotes and line breaks. Commas, tabs, semicolons and pipes are detected from the header row.
By Ankit Aglawe · Updated · Runs entirely in your browser
id and mrr become numbers, and 49.00 becomes 49. TRUE and false both become booleans. The zip 02134 keeps its leading zero as a string, while 10001 becomes a number. The empty last cell becomes "".
id,email,zip,plan,active,mrr
101,[email protected],02134,pro,TRUE,49.00
102,[email protected],10001,free,false,0
103,[email protected],94107,team,true,[
{
"id": 101,
"email": "[email protected]",
"zip": "02134",
"plan": "pro",
"active": true,
"mrr": 49
},
{
"id": 102,
"email": "[email protected]",
"zip": 10001,
"plan": "free",
"active": false,
"mrr": 0
},
{
"id": 103,
"email": "[email protected]",
"zip": 94107,
"plan": "team",
"active": true,
"mrr": ""
}
]The quoted subject keeps its comma. ""reset"" turns into "reset" and the line break inside the quoted body stays inside one field, so the output still has exactly two objects.
ticket,subject,body,priority
T-1,"Login fails, again","User says ""reset"" link expired.
Tried twice.",high
T-2,Billing question,Can I switch plans?,low[
{
"ticket": "T-1",
"subject": "Login fails, again",
"body": "User says \"reset\" link expired.\nTried twice.",
"priority": "high"
},
{
"ticket": "T-2",
"subject": "Billing question",
"body": "Can I switch plans?",
"priority": "low"
}
]Each cell is typed on its own. 42, -0.5, .5 and 1e3 become numbers. true/false in any case become booleans and null or nil become null. Quoting does not stop this: "10001" still becomes 10001.
Integers with a leading zero, like zip codes 02134 or ids 007, are kept as strings so the zero is not lost. 0.5 is still a number.
A long numeric id such as a 19-digit order number becomes a JSON number and loses precision past 2^53. If you need it exact, convert the column to text first.
Fields wrapped in double quotes may contain commas and line breaks, and "" inside them is one quote. CRLF, LF and lone CR line endings are all accepted.
Every object gets every header key. If a row has fewer cells than the header, the missing keys are set to "". Cells beyond the last header column are dropped.
Spaces inside unquoted cells are kept, as RFC 4180 says, so a, b gives the key " b" and a cell 42 stays the string " 42". A UTF-8 BOM at the start of the file is removed. An empty cell becomes the empty string "", not null.
A quoted field with no closing quote is an error that names the line it started on, rather than silently swallowing the rest of the file into one cell.
The delimiter is whichever of comma, tab, semicolon or pipe appears most often in the header row outside quotes, with comma winning ties. European Excel exports with ; and TSV files work as pasted. The first row is always the header. Duplicate header names collapse into one key, and the last column wins.
| CSV cell | JSON | Notes |
|---|---|---|
42 | 42 | |
49.00 | 49 | Numbers lose trailing zeros |
02134 | "02134" | Leading zero kept as string |
TRUE / false | true / false | Case-insensitive |
null / nil | null | |
| (empty) | "" | Also for missing cells |
"a, b" | "a, b" | Quotes removed |
+15551234 | "+15551234" | Leading + stays a string |
Enter CSV text with a header row in the left editor. Comma, tab, semicolon and pipe delimiters are detected automatically.
The output shows a JSON array where each CSV row is an object with header names as keys. Numeric values are auto-typed.
Copy the JSON to your clipboard or download it as a .json file for use in APIs, databases, or JavaScript applications.
Paste the CSV, header row first, into the left pane. You get a JSON array of objects whose keys are the header names.
Yes. Numeric cells become numbers and true/false become booleans. Values with a leading zero stay strings so zip codes and ids keep their zeros.
Yes, as long as the field is wrapped in double quotes, which is what Excel and Google Sheets do when they export.
Yes. Comma, tab, semicolon and pipe are detected from the header row, so TSV files and semicolon exports from European Excel convert without changes.
The missing keys are filled with an empty string, so every object has the same keys.
No. Parsing runs in your browser.
Need several formats at once? Convert All shows every output from one paste. Or browse all JSON converters.