Convert a newline list to a JavaScript array
Set the input to One item per row and the output to JavaScript array. Each line becomes a string in the array.
red
blue["red", "blue"];Paste a list or load a UTF-8 file to create arrays, JSON or MySQL INSERT statements. Your input stays in your browser.
See worked conversion examplesSet the input to One item per row and the output to JavaScript array. Each line becomes a string in the array.
red
blue["red", "blue"];Choose Comma separated (CSV), check First row contains column names, and select Column 1 (id) and JSON array. ArrayCat extracts the selected column as a flat array of values. Leading zeros survive even with type detection enabled.
id,product
001,"Pencil, blue"
042,Notebook["001", "042"]Choose One item per row and SQL INSERT (MySQL). Set the table name to products and the column name to name. ArrayCat encodes each value as UTF-8 hex so punctuation is preserved.
PenINSERT IGNORE INTO `products` (`name`) VALUES (CONVERT(X'50656e' USING utf8mb4));ArrayCat is a free converter for JavaScript, PHP, Go, Delphi and Pascal arrays, Python lists, JSON arrays, MySQL INSERT statements and plain lists. Copy or download the result after converting.
Remove duplicates and empty items, count repeated values, sort lists, remove diacritics, change letter case, fix quotation marks, normalize whitespace, encode HTML entities or convert values to UTF-8 Base64. Expand Transformations to choose which operations to apply.
JSON keeps values as strings by default. Type detection can turn values such as 42, true and null into JSON numbers, booleans and null. Values with leading zeros, unsafe integers and numbers that would lose precision stay as strings. The row length setting wraps arrays between values and keeps individual values intact. Pascal and Delphi output uses UTF-8 source and fixed UnicodeString arrays, which require at least one value.