CSV Transposer

Swap rows and columns in a CSV file.

Input
CSV input
Output
Result
Options

Detected automatically unless you pick one.

About this tool


Transposing turns rows into columns and columns into rows. It is what you need when a file arrives with records running horizontally, one row per field rather than one row per record, which most tools cannot read.

This layout is common in exported reports and hand-built spreadsheets, where each metric occupies a row and each period a column.

How to use it

  1. Paste or upload your csvDrop a file onto the input pane, use the file picker, or paste the text directly.
  2. Adjust the options if neededThe defaults suit most input; open Options to change the behaviour.
  3. TransposePress Transpose, or use Ctrl+Enter (Cmd+Enter on macOS).
  4. Copy or downloadCopy the result, or download it as a .csv file.

Worked examples


Each example below is executed against this tool by the test suite, so what you see is what the tool actually produces.

A two-by-two grid

Input

a,b
1,2

Output

a,1
b,2

The header row becomes the first column.

What to watch for


The details that decide whether a conversion is correct, and where information can be lost without any error being raised.

Every cell moves position
The cell at row 2, column 3 ends up at row 3, column 2. The first row becomes the first column, so a header row becomes a header column. No data is lost; only its arrangement changes.
Short rows are padded first
Transposing requires a rectangular grid, so rows shorter than the longest are padded with empty cells. Without that, columns would shift out of alignment.
Headers become data
The tool treats all rows uniformly, so the original header row becomes the first column of the output rather than remaining a header. That is what transposition means, but it does mean the result may need its header adjusted for a subsequent import.
Wide output from tall input
A file with thousands of rows transposes into thousands of columns, which many spreadsheets cannot open, Excel caps at 16,384 columns. Transposition is most useful on small, wide-ish files.

Limitations


  • A tall file becomes a very wide one, which may exceed spreadsheet column limits.
  • Header semantics are not preserved, since headers become data.
  • Processing happens in your browser, so very large inputs are bounded by available memory. Files above roughly 10 MB are handled but will feel slower, and multi-hundred-megabyte files are better suited to a command-line tool.

Questions


What happens to my header row?
It becomes the first column, which is what transposing means. You may need to adjust the header afterwards depending on what consumes the file.
Can I transpose a very large file?
Be careful: thousands of rows become thousands of columns, and Excel stops at 16,384. Transposition suits small files best.