Source: https://bscan.info/tools/array-converter
Language: en

Convert a list of values into code arrays for JavaScript, Python, PHP, Perl, and CSV. Free, private, runs entirely in your browser.

# 

Array Converter

Convert a list of values into formatted arrays for JavaScript, Python, PHP, Perl, and CSV.

All processing happens locally in your browser. Nothing is sent to any server.

Quote style:

Quote numbers

Variable:

## Input (one value per line)

0 items

Output will appear here as you type

## What is the Array Converter?

The Array Converter transforms a plain list of values into properly formatted array syntax for multiple programming languages. Paste a list with one item per line and instantly get output for JavaScript, Python, PHP, Perl, and comma-separated values (CSV). It handles quoting, escaping, and language-specific syntax automatically so you don't have to format arrays by hand.

### When is this useful?

Converting lists to code arrays is a common task when working with spreadsheet data, database exports, configuration values, or API payloads. Instead of manually adding quotes, commas, and brackets, paste your raw data and copy the formatted result. The tool supports toggling between single and double quotes, optionally leaving numeric values unquoted, and adding a custom variable name for the assignment.

### Supported languages and formats

Output is generated for JavaScript arrays (square bracket notation), Python lists, PHP arrays (using the array() syntax), Perl arrays (using parentheses with @ sigil), and plain [CSV](https://en.wikipedia.org/wiki/Comma-separated_values). Quotes inside values are automatically escaped with backslashes to produce valid syntax. All conversion happens live in your browser as you type. Nothing is sent to a server.

---
This is the page's server-rendered documentation. Interactive browser tests, file processing and permission prompts require the HTML page; Markdown does not contain live measurements or process files.
