Developer tools
Transpose CSV rows and columns
This tool transposes CSV: each column of your table becomes a row, so the first row turns into the first column and every value moves to the matching place. Paste CSV or open a UTF-8 file. The swap runs in your browser, and you copy or download the result as CSV or TSV.
Processed in your browser
Paste CSV, or open a UTF-8 file.
Enable JavaScript to transpose CSV.
First row and first column are ordinary data and always included. Blank or duplicate header-like values keep their positions.
Transposed result
No result yet
Scroll within the table to see more columns. With the table focused, use the arrow keys.
Copy and download always include the entire transposed result.
How to transpose a CSV file
Paste CSV into the CSV input box, or select Open file to read a UTF-8 .csv, .tsv or .txt file; a file is transposed as soon as you choose it. Input delimiter starts on Auto-detect, which tries comma, semicolon, tab and pipe. Choose one yourself if the input preview looks wrong.
Ragged rows sets what happens when rows have different numbers of fields. Pad missing cells is the default, and Require equal field counts stops with an error instead.
Select Transpose CSV. The Transposed result panel shows the size before and after, and a preview of 25 rows and 8 columns at a time. Input preview switches to your original table.
- Paste or open CSV
Paste into CSV input, or choose Open file for a UTF-8 .csv, .tsv or .txt file.
- Check rows and transpose
Set Input delimiter and Ragged rows, then select Transpose CSV. Compare Input preview with Transposed preview.
- Choose CSV or TSV export
Set Copy / export delimiter, then use Copy CSV or Download CSV. Tab output changes these actions to Copy TSV and Download TSV.
Example: names and months
Load example fills the box with three rows, Name,Jan,Feb then Ada,12,15 then Lee,9,11, and transposes them with the comma delimiter. The result is Name,Ada,Lee then Jan,12,9 then Feb,15,11. The names that ran down the first column now run across the first row, and each month has a row of its own.
Rows of different lengths work too. The input id,a,b,c then 1,x then 2,y,z has 3 rows and 4 columns at its widest. With Pad missing cells, the output has 4 rows and 3 columns, and the result reports 3 missing cells padded with empty fields. The last row holds c and two empty fields.
With Require equal field counts, the same input stops with a message that the rows have different field counts, and no output is made. Fix the short rows, or switch back to padding.
Headers, quotes and values
The tool has no header setting. Every record is data, so the header row becomes the first column, and blank or repeated header names stay in their places. Nothing is renamed, sorted or removed.
Values stay as text. In a check of the same code, 007 kept its leading zeros, -5 and +1 kept their signs, and =SUM(A1) stayed as written. Quoted commas, doubled quotes, a line break inside quotes, and characters such as 東京 and emoji each stay inside one field.
The option Prefix formula-like cells with an apostrophe on copy/export puts an apostrophe before any value that starts with =, +, - or @, or with a tab or line break. In the check it changed 3 cells: -5, =SUM(A1) and +1. The export status reports how many cells changed. Leave it off to keep every value as it is.
Output format
Each output field is wrapped in double quotes, and records end with CRLF. The text is UTF-8 without a byte order mark. A byte order mark at the start of the input is removed, and a final line break does not add an empty row.
Copy / export delimiter sets the output separator: Comma, Semicolon, Tab (TSV) or Pipe. It does not have to match the input, so a semicolon file can come out with commas. With Tab chosen, the buttons read Copy TSV and Download TSV, and the file is named transposed.tsv. Otherwise it is transposed.csv.
A blank line in the middle of the input is a record with one empty field, so with Pad missing cells it turns into an empty column. Text pasted into the box uses LF line breaks. Open a file when a quoted field must keep a CRLF break.
Limits
The tool swaps rows and columns and nothing else. It does not pivot or group values, add up numbers, edit cells, or remove rows and columns. It reads UTF-8 text only: a file in another encoding stops with an error, and so does a quoted field that never closes.
The tool sets no cap on rows or file size. In a Node check of the same code, a header and 100,000 data rows of 20 columns became 20 rows of 100,001 columns. In the browser, its memory and text length limits set the size you can transpose, and a run past them stops with an error. Cancel stops a run and keeps your input.
The preview shows 25 rows and 8 columns at a time, with buttons for the next rows and columns. Copy and download always include the whole result.
Questions
What does it mean to transpose data?
To transpose a table is to swap its rows and columns. The value in row 2, column 3 moves to row 3, column 2, and a table of 3 rows and 5 columns becomes 5 rows and 3 columns. The values themselves do not change; only their places do.
How do I transpose data vertically?
Paste the values as one row, such as Mon,Tue,Wed, and select Transpose CSV. The result is one column, with Mon, Tue and Wed on separate rows. It works the other way too: a single column of values becomes one row, with the values separated by the delimiter you choose.
How do I transpose a CSV file online?
Select Open file and choose the CSV, and the tool transposes it right away with the delimiter it detects. Check the Transposed preview, then select Download CSV to save transposed.csv. To paste instead, put the text in the CSV input box and select Transpose CSV; nothing needs to be installed.
What happens to rows with missing fields?
With the default, Pad missing cells, short rows are filled with empty fields so that every output row has the same length, and the result shows how many cells were padded. A padded cell looks the same as an empty field from the input. Choose Require equal field counts to stop instead.
Will Excel open a transposed CSV?
Yes, as long as it fits on one sheet. An Excel sheet holds at most 16,384 columns and 1,048,576 rows. After a transpose, each input record becomes a column, so a CSV with more than 16,384 records, header included, gives a table that is too wide for one sheet.
Does transposing twice restore my input?
For a rectangular table, yes: in a check, transposing the example twice gave back the same values in the same places. The quotes, delimiter and line endings may differ from your file. Padding and apostrophe prefixes change values, so a ragged table comes back with its short rows filled in.
Is my CSV uploaded?
No. The text or file is read and transposed by a worker in your browser, and nothing is uploaded or stored. Copy writes the result to your clipboard only when you select it. Reset clears the input and the result, and leaving the page clears them too.