Search DevTools

Jump to any tool or page

CSV Column Extractor

Pick, drop and reorder CSV columns in the browser — quoting, embedded newlines and odd delimiters all handled.

Columns

Paste or upload a CSV and its columns appear here.

Input

paste, or upload a .csv

Output

Load a CSV to see its columns.

About this CSV column extractor

Pick the columns you care about, drop the rest, and get valid CSV back. Selection order becomes output order, so this doubles as a column reorderer — useful when a downstream importer expects a fixed header sequence. Everything runs in your browser; no row ever leaves the page.

Why not just split on commas

CSV is not a comma-separated list of values — it is a quoting format. Under RFC 4180, a field may be wrapped in double quotes, and a quoted field is allowed to contain the delimiter, a literal newline, and quote characters themselves (escaped by doubling them: "he said ""hi"""). A naive line.split(",") shreds "Doe, Jane" into two fields and shifts every column after it. Splitting on newlines first is just as wrong, because an address field can legally span several physical lines. This tool parses with a real streaming CSV parser, so quoted commas and embedded newlines survive the round trip.

Headers, duplicates, and the BOM

Rows are keyed by header name. When a file repeats a header — two id columns, say — the later one wins in a keyed object and the earlier is silently lost, so duplicates are flagged before you select anything. Excel and Google Sheets also write a UTF-8 BOM at the start of the file, which turns the first header into U+FEFF id and makes exact-name lookups fail; the BOM is stripped on load.

Delimiters and TSV

The delimiter is detected from the file, so comma, tab, semicolon, and pipe-separated exports all load without configuration. Semicolons are the norm in locales where the comma is the decimal separator. On output you choose the delimiter independently — tab-separated is the safer target when the data is full of commas, since far fewer fields then need quoting at all, though tabs inside a field still do. Turn on quote all fields when the consumer is strict or when you want numeric-looking IDs to stay text.

Tip: parse warnings report a row index. A stray TooFewFields usually means an unbalanced quote earlier in the file swallowed a line break.

Data Transformation

About CSV Column Extractor

Select the columns you want from a CSV and export just those, in the order you picked them. Parsing goes through a full RFC 4180 reader rather than splitting on commas, so quoted fields containing commas, newlines, and escaped quotes survive the round trip intact.

Frequently asked questions

Why not just split each line on commas?
Because a comma inside a quoted field is data, not a delimiter. The row a,"Smith, John",b has three fields, but splitting on commas yields four and shifts every column after it. Quoted fields may also contain literal newlines, so a single record can span several physical lines, which breaks any approach that reads the file line by line first. Both cases appear constantly in real exports, which is why this tool uses a proper parser.
My file opens fine in Excel but the first column name looks wrong.
That is almost certainly a byte order mark. Excel writes UTF-8 CSVs with a leading BOM (EF BB BF), and a parser that does not strip it makes the first header literally \ufeffid rather than id, so lookups against that column silently fail. This tool strips the BOM on both upload and paste. If you see the problem elsewhere, the BOM is the first thing to check.
What happens if two columns have the same name?
You get told, because it is ambiguous rather than automatically wrong. Header-keyed parsing collapses duplicates: with two columns named email, one overwrites the other and a column of data disappears without an error. This tool detects repeated headers and reports them, so you can rename them at the source before extracting anything.
Does the output preserve the order I selected?
Yes, selection order is output order, and each chosen column shows its position. This is the useful behaviour for reshaping a file to match an import template that expects a specific column sequence, which is the common reason for extracting columns in the first place rather than simply deleting some.
When should I use tab-separated output instead?
When your data contains commas often enough that quoting dominates the file, or when the consumer is a tool that splits naively. Tabs rarely appear inside ordinary field values, so TSV needs far less quoting and is more robust against sloppy readers. It is not a universal fix, since a tab can still appear in free-text fields, but for exports headed into shell pipelines or spreadsheets it usually causes fewer problems than CSV.