Dev TooloraLocal dev tools

> Formatters

CSV Columns

Pick, reorder, repeat, rename and transpose CSV columns locally by header name or position. The input separator is detected and kept.

Runs locallyWorks offline
Back to results
Input

Source data

Turns rows into columns after selecting and renaming.
Output

Result

Your result will appear here.

Tool guide

About this tool.

List header names or 1-based column numbers separated by commas, such as name, 1. The columns appear in the order you list them, and a column listed twice is repeated. Names are matched exactly, including case. If a header name appears more than once, the name selects its first column; use the column number for the others. A token made only of digits is always a number, so a header named 2024 can be reached only by its position. Empty entries are ignored, and an empty list keeps every column.

Steps run in a fixed order: select the columns, then rename, then transpose. Rename takes old=new pairs separated by commas, and old is a header name of one of the selected columns; every column with that name is renamed, and all pairs see the names before renaming, so a=b,b=a swaps two headers. If the same old name is listed twice, as in a=x,a=y, the last pair wins. Transpose turns the rows into columns, so the header row becomes the first column.

Paste CSV or TSV text, or pick a sample.

List the columns to keep by header name or number, in the order you want.

Optionally add old=new pairs to rename headers, and turn on Transpose to swap rows and columns.

Copy the result or save it as a .csv or .tsv file.

  • id,name,age with Columns name, 1 → name,id.
  • Rename name=full_name → the header name becomes full_name.
  • Columns 2,2 → the second column twice.
  • id,name / 1,Ada with Transpose → id,1 / name,Ada.

  • Processing is local; nothing is uploaded.
  • Limits: 5,000,000 characters, 100,000 data rows, 10,000 columns and 1,000,000 cells including the header, for both input and output; transposing needs at most 10,000 rows.
  • Steps run in order: select, then rename, then transpose.
  • A repeated header name selects its first column; use the column number for the others. If rename lists the same old name twice, the last pair wins.
  • A token made only of digits is always a 1-based position, never a header name. Header names are matched exactly, including case.
  • The input separator is detected and kept. Output records always end with LF (\n).
  • Formula-like cells are not escaped: the tool reshapes and does not sanitize.

FAQ

Questions about CSV Columns

What happens with a column that does not exist?

An unknown header name is an error that names it, and so is a column number the CSV does not have. The message says how many columns there are.

How are ragged rows handled?

A row with fewer fields than the header gets empty cells in the selected columns. Fields beyond the header width are dropped, because only header columns can be selected.

Is the separator kept?

Yes. The separator is detected from the first 20 records, as in CSV Delimiter Converter, and the output uses the same one. Use that tool to change it.

Why can transposing fail?

The output must stay within the CSV limits, so a transposed table can have at most 10,000 rows in the input, which become its 10,000 columns. A larger input is an error.

Are formula-like cells escaped?

No. This tool reshapes columns only; cells starting with =, +, - or @ are written unchanged.

Continue with

CSV Delimiter ConverterChange the separator of CSV text locally: comma, semicolon, tab (TSV) or pipe, detected or chosen. Quoted fields, line breaks in cells and ragged rows are kept.JSON ↔ CSV ConverterConvert JSON records to CSV or TSV and CSV back to JSON, with quoted headers, multiline cells, leading zeros and an explicit separator.