Array converter
Turn a messy list into a clean array in sixteen languages.
Runs entirely in your browser · nothing uploaded · free, no sign-up
Output language
About this tool
Paste a list in whatever state it arrived — numbered, bulleted, comma-separated, quoted, or copied out of a spreadsheet — and get back a properly escaped array in the language you are working in.
It handles the tedious parts: stripping bullets and numbering, removing stray trailing commas, unwrapping quotes, deduplicating, and escaping quotes correctly for each language so the result compiles rather than nearly compiling.
How to convert a list into an array
- Paste your list. Any format works — one item per line, comma separated, numbered, bulleted, or copied from a spreadsheet column.
- Choose your language. Pick from the language buttons above the result. The output updates immediately.
- Adjust if needed. Set the variable name, quote style, sorting, and whether to remove duplicates or empty items.
- Copy the result. Press Copy and paste it straight into your code. Quotes are already escaped for the language you chose.
What it supports
- PHP — $items = [ ... ];
- JavaScript and TypeScript — const items = [ ... ];
- Python — items = [ ... ]
- Java and C# — String[] items = { ... };
- Go — items := []string{ ... }
- Ruby, Swift, Kotlin, Rust
- SQL — IN ('a', 'b') with quotes doubled correctly
- JSON, YAML, CSV and Bash arrays
Questions
Is my data sent anywhere?
No. The tool runs entirely in your browser. Nothing is uploaded, stored or logged, and it keeps working with the network disconnected. You can verify that in your browser's network tab.
Which languages does it support?
PHP, JavaScript, TypeScript, Python, Java, C#, Go, Ruby, Swift, Kotlin, Rust, a SQL IN clause, JSON, YAML, CSV and a Bash array.
Does it handle quotes and apostrophes correctly?
Yes, and this is the part most converters get wrong. Each language uses its own escaping rules — a name like O'Brien becomes 'O''Brien' in SQL but 'O\'Brien' in PHP. The output is escaped per target language.
Can it detect numbers?
Yes. If every item is numeric the array is emitted unquoted, with the right element type where the language needs one. Turn it off if you want numbers kept as strings.
Is it really free?
Yes, with no sign-up and no limits. We build tools like this because they are useful and because people who find them useful sometimes remember who made them.
Built by a software company
We make tools like this for our own work. When a business needs something larger built properly, that is the day job.