Skip to content

Array to text

Parse a JavaScript, Python, PHP, JSON or SQL array literal and list its items as plain text.

Input
Output

Array to text

Paste an array or list literal — a JavaScript or JSON array, a Python list, a PHP array() or short [ ] syntax, or a SQL IN() clause — and this tool parses it and prints the items as a plain list, one per line by default. It is the reverse of writing an array by hand: paste the code you have, and get the values back out as text you can search, diff or paste into a spreadsheet.

The parser reads real array syntax rather than just splitting on commas, so it correctly handles quoted strings that contain commas, escaped quotes, and nested arrays or objects. "Remove quotes" strips the surrounding ' or " from each string item, and "Unescape characters" turns \n, \t and \uXXXX sequences inside a value into the real characters they represent — turn either off to keep the source syntax closer to the original. "Flatten nested arrays" splices a nested array's items straight into the flat list instead of keeping it as one item; leave it off to see the nested literal as-is.

Formatting options shape the output rather than the parsing: choose how items are joined (new line, comma, semicolon, tab, or your own delimiter), add a prefix or suffix to every line, number the items, trim stray whitespace, and drop empty items. If the pasted text isn't a recognizable array literal, or a quote or bracket is left open, the tool points at roughly where the problem is instead of failing silently.

Everything runs locally in your browser. The array you paste — API payloads, database IDs, config values — is never uploaded anywhere. Copy the result, download it as a .txt file, or send it straight into another tool to continue cleaning it up.

FAQ

Which array formats can it parse?
JavaScript and JSON arrays, Python lists, PHP array() and short [ ] syntax (including associative arrays, where only the values are kept), and SQL IN() clauses — with or without a leading variable assignment or SELECT statement around them.
What does "Flatten nested arrays" do?
With it on, the items of a nested array like [1, [2, 3], 4] are spliced into the flat output as 1, 2, 3, 4. With it off, the nested array is kept as a single item, printed as it appeared in the source.
Why keep "Remove quotes" and "Unescape characters" separate?
They control different things: removing quotes strips the quote characters that delimit a string, while unescaping decodes sequences like \n inside the value. Turning one off without the other lets you keep the source syntax closer to the original when that is useful.
What happens if the input isn't a valid array literal?
The tool reports what went wrong — no array or list literal found, an unterminated string, or a missing closing bracket — along with roughly where in the text the problem starts, instead of returning a silently wrong result.
Is my array uploaded anywhere?
No. Parsing runs entirely in your browser, so the array you paste never leaves your device.