Home Tools Blog About

Extract CSV Columns

In short

Extract columns from CSV by name, 1-based index, or range - RFC 4180 parser, output as CSV/TSV/JSON. Free, offline, client-side, instant, secure.

  • Runs in your browser
  • Nothing uploaded
  • Free, no sign-up

Select columns by name, 1-based index, negative index (-1 = last), or range (2-5). Uses a real RFC 4180 parser - quoted fields with commas and newlines round-trip cleanly. Output as CSV, TSV, or JSON.

- paste CSV to begin
🛡
100% PrivateNo server uploads, ever
InstantRuns in your browser
💧
No WatermarksClean output, always
🆓
Free ForeverNo accounts, no limits

How to Use Extract CSV Columns

  1. Paste your CSV. Drop in a comma-, tab-, semicolon-, or pipe-separated table. Quoted fields with commas inside are handled - that's the whole point of the proper parser.
  2. Tell the tool how to read it. Pick the input delimiter from the dropdown (comma by default). Keep "First row is a header" checked if your CSV has column titles.
  3. Type which columns you want. Several syntaxes are supported, comma-separated:
    • 1,3,5 - 1-based indices (column 1 is the first one)
    • 2-5 - inclusive range
    • -1 - last column (Python-style)
    • name,email - column names (case-insensitive; needs a header row)
    • Mix and match: name,3,-1
  4. Pick the output format. CSV uses your selected delimiter. TSV always uses tab. JSON produces an array of objects keyed by header names (requires a header row).
  5. Read the stats line. Input rows × cols → output rows × cols, byte sizes, and any warnings about unknown column names.
  6. Copy or download. Ctrl/Cmd + Enter copies. Download saves extracted.csv, extracted.tsv, or extracted.json by format.

Frequently Asked Questions

What CSV syntax is supported?

RFC 4180 with permissive line endings. Fields can be wrapped in "…"; inside a quoted field, "" represents a literal "; quoted fields can contain the delimiter and newlines. Unquoted fields stop at the delimiter or end of line. CR, LF, and CRLF are all accepted as row terminators.

How do I select columns by name?

Keep “First row is a header” checked, then put header names in the selector field – comma-separated, case-insensitive. name,email picks those columns regardless of position. Unknown names are reported as a warning in the stats line (rather than failing the whole extraction).

Can I reorder columns?

Yes – the output column order matches the selector order. Type 3,1,2 and the output has column 3 first, then 1, then 2. Combine with names: email,name,age reorders even when those aren’t in that order in the source.

What does the JSON output look like?

With a header row, JSON output is an array of objects keyed by the extracted header names – e.g. [{"name":"Smith","email":"jsmith@..."}, …]. Without a header row, it’s an array of arrays. Trailing empty rows are not deduplicated; each input row produces one output entry.

How big can my CSV be?

The parser is O(n) and runs entirely in your browser’s main thread. Typical limit before lag becomes noticeable: ~100 MB of CSV text. The 200 ms input debounce keeps typing-while-editing smooth even on large pasted inputs.

What about quoted text and special characters?

Quoted text round-trips cleanly. The output quoter wraps a field in "…" (and doubles internal quotes) only when the field contains the output delimiter, a quote, or a CR/LF. Otherwise it leaves the field unquoted. So plain stays plain, but he said "hi" becomes "he said ""hi""".

What about uneven row lengths?

The parser uses the first row’s column count to define how many columns exist. If subsequent rows have fewer fields, missing selectors produce empty cells (''). If subsequent rows have extra fields, the extras are simply ignored – selectors are projected from the columns the parser saw on that row, with empties for any beyond.

Is my data uploaded?

No. The page loads three static files (HTML, CSS, JS) and then runs entirely in your browser. Your CSV bytes never leave the device – no fetch, no XHR, no analytics, no cookies. You can disconnect from the internet after the page loads and the tool still works.

Is this tool free?

Yes – free, unlimited, no signup, no watermark. The extracted CSV/TSV/JSON is yours to use anywhere. Attribution to is appreciated but not required.

Keep going

Related Tools

All Csv tools →
Share

Embed this tool

Add this free tool to your website. Copy and paste the code: