Swap Two CSV Columns Without Uploading
Exchange the contents of two columns across every row. Identify each column by a 1-based position (the default is columns 1 and 2) or by its header name. You can fill empty cells, drop comment lines, and skip empty lines.
This tool runs in your web browser: your files and text are processed on your device and are not uploaded to TidyKit servers. Free, no sign-up.
How to swap columns
1. Paste your CSV. 2. Enter the two positions, or switch to headers and type the two column names. 3. Copy the result, where those two columns have traded places and the others stay put.
`name,country,score` with columns 2 and 3 swapped becomes `name,score,country` on every row.
Errors you may see
If a header cannot be found, or a position is less than 1 or larger than the number of columns, the tool reports that instead of guessing. The table is processed in the browser and is not uploaded.
Frequently asked questions
Are positions counted from 1 or from 0?
From 1. The first column is 1.
Is my table uploaded?
No.
Can I swap more than two columns at once?
Not in a single step. Swap once, then swap again if you need a more complex order.
What does empty-value filling do?
When it is on, empty cells can be given your custom filler so the grid stays rectangular.
More CSV Tools
- Change CSV Separator – Change CSV file delimiter
- Convert CSV Rows to Columns – Convert CSV rows to columns.
- Convert CSV to JSON – Convert CSV data to JSON format.
- Convert CSV to TSV – Convert CSV data to TSV format.
- Convert CSV to XML – Convert CSV data to XML format.
- Convert CSV to YAML – Quickly convert a CSV file to a YAML file.
- Find incomplete CSV records – Quickly find rows and columns in CSV that are missing values.
- Insert CSV columns – Quickly insert one or more new columns anywhere in a CSV file.
- Transpose CSV – Quickly transpose a CSV file.
- TSV to JSON – Convert TSV to JSON format