All posts

How to Transpose a CSV (Turn Rows Into Columns and Back)

··3 min read

To transpose a CSV, turn every row into a column and every column into a row. The transpose CSV tool does it in your browser. Upload a CSV or .xlsx file, or paste it, check the row and column counts before and after, read the preview and download the flipped file. The first column of your original becomes the header of the new one.

Nothing is uploaded; the file is read on your device.

When you need to flip a table

Reports often come with one row per metric and one column per day, while the tool you are loading wants one row per day. Flipping the table fixes the shape without retyping a cell. It also helps when a form export puts each answer in a column and you want to read one person's answers down the page.

The header row counts as an ordinary row, so Metric, Mon, Tue, Wed becomes the first column of the new file.

Doing it by hand

  • Excel, Paste Special. Select the range and copy it. Right-click an empty cell, choose Paste Special and tick Transpose. The result is a static copy.
  • Excel, formula. =TRANSPOSE(A1:D10) returns the flipped range and updates when the source changes. In older versions of Excel it must be entered as an array formula.
  • Google Sheets. =TRANSPOSE(A1:D10), or Edit, Paste special, Paste transposed.

Both work well for a range on screen. For a file you only need to convert and save, a tool saves the round trip through a spreadsheet, which also avoids Excel reformatting values such as ZIP codes on the way.

Step 1: load the file

Upload the CSV or .xlsx, or paste the cells with the header row first.

Step 2: check the counts

The rows and columns before and after are shown. A table of 5 rows and 20 columns becomes 20 rows and 5 columns, so the numbers should swap.

Step 3: read the preview and download

In the preview, the first column of your file is now the header row. Download the transposed CSV.

Uneven rows

If some rows have fewer cells than others, the missing cells become blanks so every row in the new file has the same width. Nothing is dropped. Flipping twice returns the original table.

To rename or reorder columns afterwards, use the CSV column editor. To check whether a file's columns line up in the first place, see finding misplaced data in CSV columns and fixing broken CSV rows before import.

Transposing is not a pivot

A pivot table summarises, for example adding up sales by region. Transposing keeps every value as it is and only changes the orientation. To count how often each value appears, use the count unique values tool; to put several rows into one cell, use group rows and join values.

What this tool cannot do

  • It treats the header row as an ordinary row.
  • It does not add up, count or summarise values.
  • A very wide table makes a very long one, and the preview shows only the first rows. The download holds all of them.
  • Only the first sheet of a workbook is read.

If the table holds email addresses

Flipping a list does not check it. Upload the addresses on the verify page: the first 100 email checks are free with a Google sign-in, no card. Each address comes back valid, risky or invalid with a reason, and nothing is sent to anyone on the list. For larger lists, see bulk email verification and pricing.

Flip your table now

Open the transpose CSV tool.

Common questions

How do I transpose a CSV so rows become columns?

In Excel or Sheets, copy the range, then Paste Special and tick Transpose. A transpose CSV tool does the same to a whole file and gives you a CSV back.

What is the header row of the result?

The first column of your original file. Blank header cells are named column_1, column_2 and so on in the preview.

What if a row is shorter than the rest?

Missing cells become blanks, so every row in the new file is the same width. Nothing is dropped.

Is transposing the same as a pivot table?

No. A pivot table adds values up by a category. Transposing only turns the table on its side and keeps every value.

Can I flip it back?

Yes. Transposing the result again returns the original table.

Check your list before you send

Real mailbox checks over SMTP, and nothing is sent to the address. Sign in with Google and your first 100 email checks are free, no card. Plans for bigger lists are on the pricing page.