Data tools

Transpose CSV

Swap a CSV's rows and columns. Column 1 becomes row 1, and so on. A ragged row (fewer cells than the widest row) is padded with empty cells rather than refused. Quote-aware. A record with a quoted field containing a literal newline stays one record, not two. Runs entirely on your device.

Runs on your device. The file is never uploaded.

Transpose CSV swaps a file's rows and columns, writing the flipped grid out as -transposed.csv. Width comes from the file's widest row, and shorter rows are padded with empty cells. There are no options, and the header is turned like any other row, so the output has no header of its own.

Input

Questions

What does transposing do to my file?

It swaps rows and columns. The first column becomes the first row, the second column becomes the second row, and so on. A file of 3 rows by 5 columns comes back as 5 rows by 3 columns, and the result line states both shapes so you can confirm it did what you expected.

Is the header treated specially?

No. There is no header option here, so the header row is transposed like any other row and becomes the first column of the output. That is usually what you want for a table you are pivoting by hand, but it does mean the result has no header row of its own.

What happens if my rows are different lengths?

Short rows are padded with empty cells rather than refused. The output width is set by the widest row in the file, and every gap is filled with an empty string, so the result is a proper rectangle. To find those ragged rows before transposing, run Find incomplete CSV records.

Will a cell containing a newline survive?

Yes. Records are parsed with quote state tracked across the whole text, so a quoted field with a literal newline inside it stays one cell rather than becoming two rows. When the transposed grid is written back out, any cell that needs quotes gets them again.

Are there any settings?

None. The tool takes one file and does one thing, so the result is the same every time you run it on the same input. Run it twice and you are back where you started. There is no delimiter option either, so a semicolon separated file should go through Change CSV separator first.

How large a file can I transpose?

There is no fixed limit, but the whole grid is held in memory and a second, transposed grid is built beside it, so a wide or tall file needs roughly twice its size in memory. Everything happens in your browser with nothing uploaded, so your own device sets the ceiling. The output is named with -transposed.csv on the end.

Related Data tools