CSV Transpose — Swap Rows and Columns in CSV Data
Transpose CSV data — swap rows with columns. Live preview, runs entirely in your browser. No uploads, no accounts, no limits.
CSV Transposer
Transpose CSV data — swap rows with columns. The first row becomes the first column and vice versa. Works entirely in your browser.
CSV transpose is one of those operations that sounds like a one-liner and is, once you understand the matrix math. The first row becomes the first column, the second row becomes the second column, the cell at (row, column) moves to (column, row). That is the entire algorithm. The reason a tool exists for what is essentially a 5-line Python snippet is that the edge cases (uneven row lengths, header handling, delimiter preservation) are annoying to get right, and the wrong answer — a transposed CSV with a misaligned header — is hard to spot in code review.
The non-obvious thing about transposition is the header question. CSV is a flat grid with an optional first row of labels. When you transpose, the first row becomes the first column, and what was a header row becomes a column of labels. For most data — sales by month, scores by student, temperatures by city — the first row is a meaningful header and the transposed version is what you want. For some data — measurements over time, with a row per measurement and a column per sensor — the first row may not be a header at all, and the transposed version needs a different shape. The tool’s default matches the standard convention; the toggle handles the uncommon case.
For a final hand-off: if the goal is feeding the data into a chart that expects vertical categories, transpose is the right step. If the goal is database import and the schema needs row-oriented data, transpose first then import. If the goal is a wider table that fits on a print page, transpose is the wrong direction — you want fewer columns, not more. The tool here is the right pick for the specific case of swapping rows and columns in CSV; for other table manipulations (pivot, unpivot, melt, stack), use a tool that knows those operations (a spreadsheet, pandas, or miller).
How to use
Paste your CSV data
Drop the CSV into the input area, or load a .csv file. The tool auto-detects the delimiter (comma, semicolon, tab) and treats the first row as the header by default. The preview shows the original and transposed grids side by side.
Adjust header behavior
Toggle whether the first row becomes the column header of the transposed output. For data with named columns (sales by month, scores by student), the default is correct. For data with named rows, toggle off.
Copy or download the result
Copy the transposed CSV to your clipboard, or download it as a .csv file. The output uses the same delimiter as the input — comma stays comma, semicolon stays semicolon.
Frequently asked
When would I need to transpose CSV data?
Three common cases: a spreadsheet was set up with categories as columns (Jan, Feb, Mar) and you need them as rows for a chart or a database import; a wide export is too wide for a printer or a viewer and you need it rotated 90 degrees; a data pipeline expects the opposite orientation from what the source provides.
What happens to the header row?
The first row of the input becomes the first column of the output by default. The cell at (0,0) — the original header's first cell — becomes the new column header. This matches the standard matrix transpose and is usually what you want for transposed data.
Will cell values be reformatted?
No — transposition is a structural change, not a data change. Every value in the original appears once in the output, in the transposed position. The tool does not re-parse numbers, dates, or booleans; the values are copied verbatim.
What if the rows have different lengths?
The tool pads short rows with empty cells to the width of the longest row before transposing. The transposed output has consistent row lengths equal to the original row count. Empty cells in the source become empty cells in the output, in the corresponding position.
Can I transpose a really large CSV?
Yes, but the in-memory representation is the input row count times the input column count. A 10,000-row by 100-column CSV is 1 million cells — fine for the browser. A 100,000-row by 1,000-column CSV may exhaust your tab's memory.
Limitations
- In-memory scalingThe full input is loaded into memory before transposing. Very large inputs (millions of cells) may exhaust the browser tab. For pipeline-scale transposition, use a CLI tool like `miller` or `csvkit`'s `csvjson` chained with a JSON-to-CSV tool.
- No formula supportCSV cells with formulas (=SUM(A1:A10), =AVERAGE(B:B)) are transposed as literal text. The formula references are not adjusted for the new position — they will refer to the wrong cells in the transposed output.
- No aggregationTransposition does not aggregate, sum, or average values. If two cells in the same column have the same value, both appear in the transposed output. For aggregation, transpose first, then use a pivot tool or a spreadsheet.
Platform notes
- macOS
- Numbers and Excel both offer Paste Special > Transpose for in-place row/column swaps. The browser tool is the right pick for one-off transpositions where opening a spreadsheet is not worth the setup time, or for content pasted from chat or email.
- Windows
- Excel's Paste Special > Transpose does the same job inside a spreadsheet. The browser tool is the right pick for CSV text — paste into Excel, transpose, save as CSV is a longer path than just using this tool.
- Linux
- The closest CLI equivalent is `miller` (mlr): `mlr --csv reshape -r '' -o wide input.csv` or a small Python script with the `pandas` library. The browser tool is the right pick for content copied from anywhere outside a terminal.
- Web
- Runs entirely client-side. Works offline once the page has loaded. The transposed output is a standard CSV with the same delimiter as the input — paste it into any spreadsheet or data pipeline without conversion.