Transpose CSV Rows and Columns
Switch CSV rows and columns when a report is laid out in the wrong orientation. The first input row participates in the transpose just like every other row, so a header row becomes the first output column and the first input column becomes the output header. Quoted commas, embedded line breaks, and escaped quotes are parsed before the table is rotated. This is a literal matrix transpose, not a pivot table: it does not group values, calculate totals, infer categories, or aggregate duplicate labels. Review the result before using it in a spreadsheet or import.
Use this without the search next time. Prathom Workbench puts Prathom's tools in your toolbar.
Add to Chrome — freeWhat it does
- Rows become columns and columns become rows
- Quoted CSV fields are parsed safely
- Uneven rows are padded with empty cells
- Input and output delimiter choices
- Local copy and download
How to use CSV Transpose
- 1
Paste the table
Include the header row if the source has one. Because transpose is a matrix operation, the header is treated as data and its position affects the output.
- 2
Choose the input delimiter
Select comma, semicolon, tab, or pipe so fields are identified correctly before the matrix is rotated.
- 3
Inspect the orientation
The output header comes from the first input column. Check labels and blank cells, especially when the original table had records of unequal length.
- 4
Copy or download
Copy the transposed CSV or download it with the selected output delimiter. Use a spreadsheet pivot when you need grouping or aggregation rather than rotation.
How it works
Output checks
Compare the number of fields and records before and after the operation, then inspect cells that contain quotes, delimiters, or blank values.
Preserve meaning while rotating data
Before transposing, decide which row or column contains labels and whether blank cells carry meaning. Afterward, inspect the dimensions, first and last records, and cells with commas, quotes, or embedded line breaks. A transposed file may be valid CSV while no longer matching the import layout expected by a spreadsheet or database. Keep the original untouched and document which axis became the header.
Transpose checks
Transposing changes rows into columns, so a header or label that made sense vertically may become ambiguous horizontally. Preview the first and last records, count the fields before and after the operation, and check quoted values that contain delimiters or line breaks. Use a copy when the CSV contains formulas or identifiers with leading zeroes. The tool changes orientation and preserves the available cell text; it does not infer a new schema or decide which row should become the header.
The converter first turns the CSV into a rectangular matrix. It keeps the first row in that matrix rather than assigning special behavior to it. The width is the number of fields in the widest parsed record, and shorter records receive empty values. The transpose then creates one new row for each original column and copies the value at each row-column coordinate into its new position.
The output writer applies normal CSV quoting after rotation. A value that contains the chosen separator, a quote, or a line break is quoted, so rotating a table does not turn one long note into several columns. No sorting, deduplication, arithmetic, type conversion, or pivot aggregation is performed.
When to use it
Transpose is useful for turning a horizontal survey or weekly report into a vertical review, preparing a key-value layout for a template, or inspecting a matrix in the opposite direction. It is not the right tool for joining datasets, summarizing transactions, or building a normalized database table. Verify labels and a few coordinates before handing the output to another system.
Examples
Turning metric rows into weekly columns
The labels in the first column become the new header. This makes each week a row and each metric a column, which can be easier to append to a report template.
Rotating a simple key-value export
The operation does not recognize that key and value have semantic roles. It simply rotates the matrix, so a semantic redesign may be better for an API.
Frequently asked questions
Is CSV transpose the same as a pivot table?
No. Transpose is a literal matrix rotation: every input row and column changes orientation without grouping or calculating anything. A pivot table groups by categories and may sum, count, or average values. Use this tool for a layout change, and use a spreadsheet or data library when aggregation is required.
What happens to the header row during transpose?
It is treated as the first row of the matrix. Its cells become the first output column, while the first input column becomes the output header. Include the header deliberately and inspect the result, because the tool cannot know whether your first row is metadata, labels, or ordinary data.
How are uneven CSV rows handled?
The parser finds the widest row and fills missing cells in shorter rows with empty strings before rotating. That prevents values from shifting into the wrong output column, but it does not repair a malformed source. Check the row count and blank cells if the original export was produced by inconsistent records.
Does transposition happen on a server?
Yes — the pasted table is sent to our server, rotated there and returned. Nothing is stored and there is no account. Keep your source and inspect the downloaded result, especially if the rows contain personal data or the output will feed an automated system where one wrong orientation has operational consequences.
Further reading
- Exported as HTML, the Table Was Sixteen Times the CSVExporting a spreadsheet to HTML is the quickest way to put a table on a page, and it produces a file that dwarfs every other format the same data fits in. Knowing where the weight comes from tells you when the export is fine and when it will cost you a page load.
- The Same Table Was Three Times Bigger as JSONCSV writes each column name once, at the top. JSON writes it again on every single row. On a table of any size that is not a subtlety — it is the dominant term, and it explains both why the conversion inflates and why it barely matters over the wire.
- We Sent a CSV Through a Spreadsheet and Watched What DiedOpen a CSV in a spreadsheet, change nothing, save it again, and the file that comes out is not the file that went in. This is well known for postcodes and product codes with leading zeros. We ran a deliberately awkward CSV through the round trip to find out exactly which fields survive and which do not.