csvkit.org
CSV (Comma-Separated Values) utilities, in the browser
Say hi →

Extract a Column as a List

newline · comma · quoted · JSON array · Python list · SQL IN (…)

Get one column out of a CSV in the exact shape you're about to paste it into — a SQL IN (…) clause, a JSON array for a fixture, a Python list, or just one value per line for a shell loop. Deduplicate and sort on the way out, so you don't paste 4,000 IDs when there are only 380 distinct ones.

extract
Or drop a .csv file here, or
ready

How to extract a column

  1. Paste the CSV or drop a file, then pick the column.
  2. Choose the output format for wherever this is going.
  3. Tick unique for an ID list you're about to query with, and sort if you want it readable.
  4. Copy it, or download as a .txt.

Formats and where they go

A note on the SQL output

Every value is emitted as a quoted string, because a CSV can't tell you whether 0042 is a number or a code. For an integer column that's harmless in most databases thanks to implicit casting, but if you need unquoted numbers, use the comma-separated format instead. And if the list runs to thousands of values, a temporary table or a join is faster than a giant IN — many databases have a practical parameter limit around a few thousand items.

FAQ

How do I get several columns at once?

Use Keep / rename / reorder to keep just the columns you want, which leaves you a narrow CSV rather than a flat list.

How do I know how many duplicates were dropped?

The status line reports it whenever unique collapses anything. For a full breakdown by value, use Value counts.

Does sorting understand numbers?

Yes — numeric values sort numerically, so 2 comes before 10. Mixed content falls back to alphabetical.

Is my data uploaded?

No. Everything happens in your browser.

Privacy

100% client-side. No upload. See the privacy policy.