Paste a list or open a UTF-8 file. Convert it to JSON, a source code array, or MySQL INSERT statements. Your data stays in your browser.
More converters
Worked conversion examples
Convert a newline list to a JavaScript array
Paste one status per line. Choose One item per row for input and JavaScript array for output. ArrayCat puts each label in quotes and escapes any double quotes or backslashes inside it.
Input
draft
published
archived
JavaScript array
["draft", "published", "archived"];
Convert a CSV column to a JSON array
Choose Comma separated (CSV) and check First row contains column names. Select Column 1: id and choose JSON array. You get one ID per data row, with the leading zeros intact even if type detection is on.
CSV input
id,product
001,"Pencil, blue"
042,Notebook
JSON output
["001", "042"]
To get the names, select Column 2: product. The quotes around "Pencil, blue" keep it in one field.
Choose Custom separator and enter ||. Check First row contains column names, select Column 2: label and choose JSON array. The quotes around red||blue keep those two pipes in the label.
Delimited input
sku||label
R01||"red||blue"
R02||green
JSON output
["red||blue", "green"]
Count repeated values in a list
Choose One item per row for both input and output. Under Transformations, turn on Convert to lower case and Count duplicate elements to count Blue and blue together. Leave Sort alphabetically off to put the most frequent values first.
Input
Blue
red
blue
Red
blue
Plain text output
3:blue
2:red
Convert a list to MySQL INSERT statements
Choose One item per row and SQL INSERT (MySQL). Set the table to products and the column to name. ArrayCat writes one statement per value and uses UTF-8 hex to keep accents, quotes and backslashes intact.
Input
Café
MySQL statement
INSERT IGNORE INTO `products` (`name`) VALUES (CONVERT(X'436166c3a9' USING utf8mb4));
Check the target table and column before running the output. With INSERT IGNORE, MySQL can skip rows with duplicate keys and turn some errors into warnings. See the MySQL INSERT reference.
ArrayCat conversion guide
Choose the input format
One item per row. Each line becomes one value, including any punctuation on that line.
Comma separated (CSV). Wrap fields that contain commas, quotes or line breaks in double quotes. Write a double quote within a field as two double quotes.
Tab separated. Use for TSV files or spreadsheet cells copied with tabs between them.
Inside quotation marks. Extract values between straight or curly quotes. Tags “red” and “blue” gives red and blue.
Custom separator. Enter the text between fields, such as | or ||. The limit is 20 characters.
JavaScript array literal or JSON array. Paste an array with its square brackets. JavaScript input accepts single quotes and trailing commas. JSON strings use double quotes.
If a result still contains whole CSV or TSV rows, check the input format. For an unclosed quote, look at the row number in the error message.
For CSV, TSV or custom-separated data, check First row contains column names if the top row is a header. Select a column to extract it, or choose All columns, in row order to put every field in one list. To keep a missing cell as an empty string in the list, turn off Remove empty elements.
Choose JSON table (one record per row) to preserve rows. Headers become keys in JSON objects. For files without headers, each row becomes an array.
Clean up, count and sort values
ArrayCat trims and drops empty values by default. Turn off Trim whitespace to keep spaces at either end. Turn on Remove diacritics and Convert to lower case to group Café and cafe as the same value.
Remove duplicates keeps the first copy of each value. Count duplicate elements counts every copy, even when both options are on. Sort alphabetically orders counts by their value. Warnings about uneven rows and long values appear below the conversion summary.
Choose Value counts (CSV) for a two-column report or Value counts (JSON) for an array of objects with value and count fields.
Choose JSON value types and output format
When you convert text to JSON, the default keeps values as strings. Type detection can write 42 as a number, true as a boolean and null as JSON null. Values such as 001 and 9007199254740993 stay as strings. Keep the string setting for values whose exact spelling matters, such as 1.2300.
For code, choose a JavaScript or PHP array, a Python list, or a fixed-size Go string array. Delphi and Pascal output uses fixed UnicodeString arrays and needs at least one value. If a value contains a line break, use JSON or a source code array to keep it in that value.
Maximum row length wraps code and JSON between values, counting any quotes and escape characters. A single long value or a declaration can exceed the limit.
Export results and reuse settings
Use Copy output to paste the result elsewhere or Download output to save it as a file. After editing the input, run the conversion again.
Save a preset for jobs you repeat, such as pulling the same column from a weekly CSV export. A settings-only preset uses the text currently in the editor. To remove text saved with a preset, delete the preset, overwrite it with Include input data in this preset unchecked, or clear the site’s browser storage. Clear data empties the editor and output.