How to convert a text list to an array
Copy a column out of a spreadsheet, a query result or a log file, paste it here, and get back a proper array literal — quoted, comma separated and ready for your code. No sign-up, no upload, no waiting.
- Paste your list One value per line, exactly as you copied it. Blank lines disappear and stray spaces are trimmed, so a messy paste out of Excel still comes out clean.
- Set the rules once Single or double quotes, numbers left bare or quoted, duplicates dropped, SQL dialect picked. The tool remembers your choices the next time you visit.
-
Copy and get back to work
Hit
Ctrl / Cmd + Enter, or leave Auto Run on and watch the output follow your typing. One click copies the whole array, even when the preview is shortened.
One text list, every array format
Your list is converted into all eight formats at the same moment. Numbers stay numbers, text gets quoted, and apostrophes inside your values are escaped the way each language expects.
Input list
apple banana 42
What you get
Eight ready-to-paste outputs, generated as you type. Keep the three you use most open side by side and switch whenever the target language changes.
JavaScript / TypeScript array
['apple', 'banana', 42]
A plain array literal for JS, TS and Node. Switch to double quotes when your linter prefers them.
SQL IN clause
IN (N'apple', N'banana', N'42')
Drops straight into WHERE column IN (...). N'...' for SQL Server, or switch the dialect for '...' on MySQL, PostgreSQL and SQLite.
Python list
['apple', 'banana', 42]
Paste it into a script, a fixture or a pytest parametrize block without retyping a single comma.
PHP array
array('apple', 'banana', 42)
Classic array() syntax that still works in older codebases and Laravel config files.
JSON array
["apple", "banana", 42]
Strictly valid JSON with real string escaping — safe for an API request body or a fixture file.
C# array
new[] { "apple", "banana", 42 }
An implicitly typed array for C# and .NET, built from the same JSON-escaped values.
Raw comma separated list
'apple', 'banana', 42
No brackets at all — the quoted, comma separated body you can drop into any language that is not on this list.
Custom pattern
EXEC MyProcedure 'apple'; EXEC MyProcedure 'banana'; EXEC MyProcedure '42';
Write your own template: {} is the value, {n} the row number from 1 and {i} the index from 0.
Built for real, messy lists
Most list to array converters give up on the first apostrophe or the first ten thousand rows. This one is built for the lists you actually paste at work.
- Nothing is uploaded. The conversion happens inside your browser. Internal IDs, e-mail addresses and customer data never leave your device.
- Large lists stay fast. The classic editor takes 50,000 lines in its stride, and the Ultra editor keeps even bigger pastes smooth.
- Quotes are escaped correctly.
O'BrienbecomesN'O''Brien'in SQL and"O'Brien"in JSON, so nothing breaks downstream. - Numbers stay numbers. Plain numeric lines come out unquoted by default, and one click turns them into strings when your schema needs that.
- Duplicates gone in one click. Switch on Dedupe and only the first occurrence of each line survives the conversion.
- Three panels at once. Show Raw, JavaScript, SQL, Python, PHP, JSON, C# or Custom, drag them into the order you like, and find the same layout waiting next time.
- Made for the keyboard.
Ctrl / Cmd + Enterconverts, Auto Run keeps short lists in sync while you type, and every panel has its own copy button. - Free and open source. No account, no quota, no ads. The whole converter is on GitHub if you want to read it or fork it.
What developers convert text lists to arrays for
Building a SQL IN clause from a spreadsheet
Copy an order-number or e-mail column out of Excel, paste it here, and get a quoted, escaped IN (...) list for your query in seconds.
Seeding test fixtures
Turn a list of SKUs, slugs or user IDs into a JavaScript, Python or C# array for unit tests and mock data.
Preparing API request bodies
Convert a list of identifiers into a valid JSON array before pasting it into Postman, curl or your REST client.
Bulk stored-procedure or script calls
Use the custom pattern to render one statement per line: EXEC calls, UPDATE statements, CLI commands or migration scripts.
Cleaning up exported logs
Paste raw log output, drop the duplicates and the blank lines, and get a clean deduplicated array on the other side.
Filling enums and config files
Move a list of country codes, feature flags or locales into the array literal your config file is waiting for.
Text list to array: frequently asked questions
What is a text list to array converter?
It is a tool that turns a plain list of values, one per line, into an array literal you can paste straight into code. ArrayHelper builds the JavaScript, SQL, Python, PHP, JSON, C# and custom versions of the same list at once, so you never hand-type quotes and commas again.
How do I convert a text list to an array online?
Paste the list into the editor at the top of this page, press Ctrl / Cmd + Enter or leave Auto Run on, then copy the panel you need. Nothing to install, no sign-up and no row limit.
Does it escape quotes and special characters?
Yes. Single quotes are doubled for SQL, and the JSON and C# outputs use real JSON string escaping, so values with apostrophes, backslashes or tabs stay valid in the target language.
Are numbers quoted?
Not by default — plain numeric lines are written as numbers and everything else is quoted. If your column is a string type, the numbers toggle in the toolbar quotes them too.
Can I remove duplicate lines while converting?
Yes. Switch on Dedupe in the options menu and only the first occurrence of each line is kept. Blank lines and surrounding whitespace are always trimmed, with or without Dedupe.
How large a list can it handle?
The classic editor is comfortable up to 50,000 lines, and the Ultra editor keeps even larger pastes responsive. Long outputs are shortened on screen for speed, but Copy always gives you the complete array.
Is my list uploaded to a server?
No. Every conversion runs locally in your browser, so your list never leaves your device — which is why the tool is safe for internal identifiers and customer data.
Can I define my own output format?
Yes. The Custom panel takes a template like EXEC MyProcedure '{}';, where {} is the line value, {n} the row number starting at 1 and {i} the index starting at 0. Every line is rendered with that template on its own row.
Which SQL dialect does the IN clause use?
Both. N'...' is the default for SQL Server; switch the SQL setting to '...' for MySQL, PostgreSQL, SQLite and other standard dialects.
Convert text lists to arrays in your language
The same converter, documented in every language below. Pick the one you think in — your saved settings follow you across all of them.