tsvkit.org
TSV Toolkit
Sample data Say hi →

Transpose TSV

rows become columns · header becomes the first column

Flip the table on its diagonal: the first row becomes the first column, and each record becomes a column of its own. The everyday use is a one-record file that's easier to read vertically — a single row with forty fields is unreadable across, and obvious down. It's also the trick for operations that only work on rows: transpose, do the thing, transpose back.

transpose
Drop a .tsv file here, or
ready

How to use

  1. Paste or drop the file.
  2. Copy or download the transposed result. Short and wide becomes tall and narrow.
  3. To reverse it, run the output through this page again — transposing twice returns the original.

The transpose trick

Several operations here work on rows and have no column equivalent. Transposing gives you them for free: to remove empty columns, transpose → remove empty rows → transpose. To deduplicate identical columns, transpose → dedupe → transpose. To sort columns by their header, transpose → sort → transpose.

The caveat is that a transposed file has no meaningful header — the first row becomes whatever the first column contained — so run these round trips before you rely on column names.

Transpose is not unpivot

Both change a table's shape, and they're different operations. Transposing swaps the axes and preserves the cell count exactly. Unpivot turns a wide table into a long one with name/value pairs, changing the row count and adding structure. When you have a column per month and you want one row per month, you want unpivot, not this.

FAQ

What happens to ragged rows?

Missing cells are treated as empty, so the output is rectangular even when the input wasn't. That means transposing quietly fixes raggedness — check with the validator first if you wanted to know about it.

Is there a size limit?

The whole grid is held in memory twice, and a very wide result is slow to render in any viewer. Ten thousand rows becoming ten thousand columns will work but won't be pleasant to open in a spreadsheet — Excel caps at 16,384 columns.

Does the header stay a header?

No, and it can't: after transposing, the old header is the leftmost column of values. The new first row is your old first column.

What's the awk equivalent?

There are one-liners, all of them unreadable, and most of them hold the whole file in memory anyway. This is one case where a browser is genuinely the easier tool.

Privacy

100% client-side. No upload. See the privacy policy.