Skip to content

Column to Array

Runs in your browser — your data never leaves your device.

Convert a column of values into a JavaScript, JSON, Python, SQL or CSV list.

Options
More
0 lines
0 items

What is Column to Array?

Column to Array turns a list of values, one per line, into code you can paste straight into your project. Copy a column from Excel, Google Sheets or a query result, choose the output format and get a JavaScript array, JSON, a Python list, a SQL IN clause or a CSV line. The conversion happens as you type, entirely in your browser.

Useful for

  • Building a SQL WHERE id IN (...) filter from a spreadsheet column.
  • Turning a list of IDs or e-mails into a JavaScript or TypeScript array.
  • Creating JSON fixtures and test data from real values.
  • Writing Python lists for scripts and notebooks.
  • Cleaning lists: trimming spaces, removing blank lines and duplicates, and sorting.

How to use

  1. Paste your column into the Input panel, one value per line.
  2. Choose the output format: JavaScript, JSON, Python, SQL IN or CSV.
  3. Adjust quotes, trailing comma, trimming, empty lines, duplicates and sorting; the output updates instantly.
  4. Click Copy to send the result to your clipboard.

Examples

Spreadsheet column to a JavaScript array

Input
apple
banana
cherry
Output
[
  "apple",
  "banana",
  "cherry"
]

Names to a SQL IN clause

Input
O'Brien
Smith
Output
IN ('O''Brien', 'Smith')

Frequently asked questions

Is my data sent to a server?

No. The conversion runs entirely in your browser. Nothing you paste is uploaded or stored on a server.

How many lines can I convert?

Tens of thousands. Pasting 10,000 lines produces the result in well under a second on a typical computer.

Why are the quote and trailing comma options disabled for JSON?

JSON only accepts double-quoted strings and does not allow a trailing comma, so the tool enforces both to keep the output valid.

How are quotes inside values handled?

They are escaped for the chosen format: with a backslash in JavaScript, JSON and Python, doubled in SQL ('') and doubled inside quoted CSV fields ("").

Can I keep numbers without quotes?

Yes. Set Quotes to None and the values are written exactly as they are, which is ideal for numeric IDs.

Related tools