CSV to Array Converter
A real CSV parser, not a comma split.
Parse the CSV
CSV to Array Converter
// Your converted output will appear here.
Quoted fields containing commas stay whole, doubled quotes are unescaped, CRLF and LF both work, and a header row can become object keys.
How to use the CSV to Array Converter
Paste the CSV
Rows separated by newlines. Copying straight out of a spreadsheet usually gives tab-separated data instead — switch the delimiter to Tab for that.
Say whether the first row is a header
With Header row on and the Objects shape selected, each row becomes an object keyed by the header names.
Choose the output shape
Flat for one array of every cell, Rows for an array per line, Objects for header-keyed records.
CSV to Array Converter examples
Header row to objects
Input
name,email,city John,john@example.com,"New York, NY"
Output
[
{
"name": "John",
"email": "john@example.com",
"city": "New York, NY"
}
]The comma inside "New York, NY" is part of the value, not a separator.
Rows as nested arrays
Input
1,2,3 4,5,6
Output
[ ["1","2","3"], ["4","5","6"] ]
Escaped quotes inside a field
Input
quote "She said ""hello"" once"
Output
[ "She said \"hello\" once" ]
A doubled quote inside a quoted field is one literal quote character.
Working with csv to array
Why splitting on commas is not parsing CSV
The line John,"New York, NY",NY has three fields, but splitting on commas gives four. Quoted fields exist precisely so a value can contain the delimiter, and honouring them is the difference between a parser and a split. This page implements RFC 4180: quoted fields, doubled quotes as an escape, embedded newlines inside quotes, and CRLF or LF endings.
Header rows and object output
With Objects selected the first row supplies the keys, so each record arrives as a name/email/city object rather than a positional array — the shape most APIs and ORMs want. If the header has duplicate names the later column wins, so rename the columns first if that matters.
Ragged rows are reported, not silently fixed
If some rows have more cells than others the tool says so rather than padding or truncating quietly. That mismatch almost always means an unescaped quote or a stray delimiter further up the file, and you want to know before the data reaches your database.
Popular text conversion tools
Comma Separated List to Array Converter
Split a plain comma-separated list into an array, trimming the space after each comma and dropping empty values. For quoted CSV fields, use the CSV parser.
Text to JSON Array Converter
Use this free online text to JSON array converter to turn lines, lists, TXT files, or delimited values into valid pretty-printed or minified JSON.
PHP Array Converter
Convert text into a PHP array using short [] or classic array() syntax, with the correct single and double quote escaping and true, false and null literals.
Numbers to Array Converter
Convert a list of numbers into an unquoted numeric array, sort it numerically, drop non-numeric values, and read the count, min, max, sum, mean and median.
CSV to Array Converter FAQs
CSV to Array Converter
A real CSV parser, not a comma split. Quoted fields containing commas stay whole, doubled quotes are unescaped, CRLF and LF both work, and a header row can become object keys.