Simple online tools for developers, networking, text and conversions.

Text Tools

Swap Columns in TSV Files

Swap two TSV columns by header name or 1-based column number.

Tool

Use this tool to swap the positions of two TSV columns. It is useful for fixing column order, matching import templates, cleaning exports, and reorganizing TSV data without manual editing.

About this tool

Use this tool to swap the positions of two TSV columns. It is useful for fixing column order, matching import templates, cleaning exports, and reorganizing TSV data without manual editing.

Use swap columns in tsv files when you need a fast browser-based result without extra setup. It works well for quick checks, one-off tasks, and routine formatting or calculation work.

Learn more

Why use this tool

How to use

  1. Put the first column selector on line one
  2. Put the second column selector on line two
  3. Leave a blank line
  4. Paste the TSV below
  5. Run the tool to swap the two columns

Examples

Example

Input

name
role

name	email	role
John	john@example.com	admin
Anna	anna@example.com	editor

Output

role	email	name
admin	john@example.com	John
editor	anna@example.com	Anna

Useful when the column order needs to be corrected fast.

Example

Input

1
3

id	title	status
1	Book	ok
2	Pen	ok

Output

status	title	id
ok	Book	1
ok	Pen	2

Supports both header-based and index-based selectors.

Common errors

Using a column that does not exist

Fix: Check the TSV header or use valid 1-based positions.

Selecting the same column twice

Fix: Use two different selectors.

Forgetting the blank line before the TSV body

Fix: Put the two selectors first, then a blank line, then the TSV.

FAQ

What does Swap Columns in TSV Files do?

It swaps the positions of two selected TSV columns.

Can I select columns by header name?

Yes. You can use exact header names or 1-based column numbers.

Does it change the field values?

No. It only changes the column order.

What if one of the columns is not found?

The tool returns an error so you can fix the selector.

When is this tool most useful?

It is most useful when TSV columns are in the wrong order for imports, exports, or review.

Use cases

Related tools