tsvkit.org
TSV Toolkit
Sample data Say hi →

Swap TSV Columns

exchange two columns, header and data together

Swap two columns' positions. It's a small operation with one specific virtue: the header moves with its data, so you can't accidentally end up with the right values under the wrong name — which is exactly what happens when people do this by hand in a spreadsheet and forget row one.

swap
Drop a .tsv file here, or
ready

How to use

  1. Paste or drop the file.
  2. Name the two columns by header or 1-indexed position.
  3. Copy or download. Everything else stays where it was.

When to reach for something else

For moving one column to the front, or reordering several at once, extract columns is faster: list every column in the order you want and the output follows. Swapping is the right tool when exactly two columns are in the wrong places relative to each other — most often latitude and longitude, or first and last name.

That coordinate case is worth calling out: if a map shows your points in the wrong hemisphere, swapped lat/lon is the reason, and TSV → GeoJSON will warn you when a latitude is outside ±90.

FAQ

Can I swap more than one pair at a time?

Run it twice, or use extract columns and list every column in the final order — one pass, any permutation.

Does the data move with the header?

Yes. The whole column moves, header included, which is the point of doing it here rather than by hand.

What if I name the same column twice?

Nothing changes — swapping a column with itself is a no-op.

Does it work without a header?

Yes, by position. Every row is treated as data.

Privacy

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