Keep only the CSV columns you need
Keep a named or positional subset of a CSV, TSV or pipe-delimited file, reorder those columns, and download a new UTF-8 table without uploading the source or mistaking quoted punctuation for structure.
A UTF-8 CSV, TSV or delimited text file up to 20 MB. It stays in this tab.
How it works
Selection is positional, even when it starts with a name
A delimited table is a sequence of rows, and each row is a sequence of fields.
The optional header gives those positions names, but the data underneath still
belongs to positions. Selecting Email therefore means: find the one header
field whose trimmed text is exactly Email, remember its zero-based internal
position, and copy that position from every later row.
That distinction matters when headings repeat. Given:
Name,Email,Email
Ada,home@example.test,work@example.test
the word Email does not identify one column. Guessing the first would create a
valid-looking file with the wrong address, so the tool refuses the ambiguity.
#2 selects the first email column and #3 selects the second. Positions shown
to people are one-based because #1 is the first visible spreadsheet column.
A blank keep-list is useful too: it selects every position. This lets the tool normalise a separator or verify a file before the visitor narrows it.
The parser cannot split on commas
The separator is structure only when it is outside a quoted field. These are three fields, not four:
Name,City,Note
Ada,London,"writes, tests"
A quoted field may also span physical lines, and a literal quote inside it is written twice. The parser therefore walks characters with one piece of state: whether it is inside quotes. Outside quotes, a separator ends a field and a line break ends a record. Inside quotes, both are text. Two quotes in a row add one quote to the current value without leaving that state.
Automatic separator detection applies the same rule to the first complete record. It counts comma, semicolon, tab and pipe candidates only outside quotes. An explicit choice remains available because no guess can recover a separator that does not appear in a one-column header.
A worked selection
Start with this four-column file:
Name,Email,City,Note
Ada,ada@example.test,London,"writes, tests"
Grace,grace@example.test,New York,"line one
line two"
Enter the following keep-list:
Email
Name
The result contains 2 data rows, keeps 2 of 4 columns, and puts Email before Name:
Email,Name
ada@example.test,Ada
grace@example.test,Grace
The comma and embedded line break in the discarded Note column are still parsed correctly; neither can create a phantom row or shift City under another heading. Those exact inputs and the exact CRLF output bytes are asserted in the tool’s tests.
What changes in the downloaded bytes
The selected cell values remain text. They are not parsed as dates or numbers,
so a code such as 007 stays 007. A short row gets an empty value for a
selected position it does not contain, rather than allowing the next field to
slide sideways.
The physical representation can change. Records are written with CRLF endings, quotes are added only where the chosen output separator or a line break requires them, and unnecessary source quotes may disappear. A UTF-8 byte-order mark is restored only when the input carried one. These changes preserve the selected table, not byte-for-byte formatting around it.
Use CSV to JSON when the next system needs named objects, or JSON to CSV when a structured response needs to become a flat table. The guide on rows, records and columns explains why those shape decisions cannot be inferred from punctuation alone.
How it is done
- Decode the chosen file as UTF-8, recording and removing any leading byte-order mark while the rows are parsed.
- Use the selected input separator, or count commas, semicolons, tabs and pipes outside quotes in the first complete record to detect it.
- Parse fields with RFC-style quoting, so doubled quotes become one quote and separators or line breaks inside a quoted field remain cell text.
- Resolve each non-empty keep-list line against an exact trimmed heading or a one-based # position; a blank list selects every source position.
- Project the header and every data row onto the same ordered positions, padding a short row with empty cells rather than shifting later data.
- Escape the selected values for the requested separator, write CRLF record endings, restore the source byte-order mark when one existed and offer the new file locally.
What it assumes
- Input text is decoded as UTF-8. Legacy Windows code pages need to be converted to UTF-8 first.
- The first row is treated as headings by default. Headerless files can be selected only with positions such as #1 and #3.
- Heading lookup trims outer whitespace but otherwise matches exactly and case-sensitively. Duplicate headings must be selected by position.
- The tool keeps and reorders complete columns; it does not rename headings, filter rows, infer data types or evaluate spreadsheet formulas.
- The 20 MB input, 500,000-row, 5,000-column and 64 MB output limits keep the complete in-browser operation bounded.
- Equivalent delimited files may use different quoting and record endings. Selected decoded cell values are preserved, not the original bytes.
Common questions
Is the CSV uploaded before its columns are removed?
No. A worker in this browser tab reads, parses and rewrites the selected file. The page's browser test loads a real CSV and fails if any request leaves the site while the file is present.
How do I select one of two columns with the same heading?
Use its one-based position, such as #2. A repeated heading is deliberately treated as ambiguous instead of silently selecting the first copy.
Will quoted commas or line breaks break the new file?
No. A separator or line break between quotes remains part of one cell, and two consecutive quotes become one literal quote. When the selected columns are written, any value that needs quoting is escaped again.
Does the selector protect cells from spreadsheet formulas?
It does not alter cell text, because this is a positional selection rather than a sanitising export. Treat a file from an untrusted source as untrusted when opening it in spreadsheet software.