Web Analytics

 Swap CSV Columns

The Swap CSV Columns tool lets you reorder the columns of any CSV, TSV, or custom-delimited file by simply typing the new column order, such as 3,1,2. You can also drop columns by leaving out their number, or duplicate a column by listing it more than once. A live preview table shows the result instantly, and everything runs 100% client-side in your browser.

⚙️ Options

Swap CSV Columns - Explanation & Examples

The Swap CSV Columns tool reorders the columns of a CSV, TSV, or custom-delimited file by letting you type the new column order as a simple list of column numbers. It also supports deleting columns (by leaving a number out) and duplicating columns (by listing a number more than once) — all processed instantly in your browser.


⭐ What Does This Tool Do?

  • Parses your pasted CSV/TSV data, including quoted fields that contain the delimiter
  • Reorders columns based on a comma-separated list of 1-based column numbers you type, such as 3,1,2
  • Drops any column whose number you leave out of the list
  • Duplicates any column you list more than once
  • Shows a live preview table of the first 5 reordered rows
  • Lets you copy the full result or download it as a file

🔎 Example: Simple Reorder

Input (columns A, B, C):

Name,Age,City
Alice,30,Paris
Bob,25,Berlin

Column order typed: 3,1,2

Output (columns C, A, B):

City,Name,Age
Paris,Alice,30
Berlin,Bob,25

🔎 Example: Delete and Duplicate a Column

Same input as above. Column order typed: 1,1

This drops column 2 (Age) and column 3 (City) entirely, and lists column 1 (Name) twice:

Name,Name
Alice,Alice
Bob,Bob

⚙️ How to Use the Tool

  1. Paste your delimited data into the input box
  2. Choose the delimiter used in your data (comma, tab, semicolon, pipe, or a custom character)
  3. Type the new column order as 1-based numbers separated by commas, e.g. 3,1,2
  4. Check the live preview table to confirm the result looks correct
  5. Copy the full output or download it as a file

🔎 Supported CSV Parsing

The tool uses a lightweight CSV line parser that correctly handles double-quoted fields, including fields that contain the delimiter character or escaped double quotes ("") inside them. This covers the vast majority of real-world CSV and TSV files without requiring a full RFC 4180 parser.


⚠️ Important Notes

  • Column numbers are 1-based — column 1 is the first column, not column 0
  • "First row is header" only affects how the preview table displays the first row; it does not change which rows are included in the reordering or output
  • Any column number not included in your column order list is simply dropped from the output, which is a quick way to delete unwanted columns
  • Listing the same column number multiple times duplicates that column in the output
  • All processing happens locally in your browser — your data is never uploaded to a server

This tool is also known as

  • swap csv columns
  • reorder csv columns
  • delete csv column online
  • rearrange csv columns
  • csv column reorder tool

Frequently Asked Questions

It reorders the columns of a CSV, TSV, or custom-delimited file based on a column order you type, such as 3,1,2. It can also delete or duplicate columns.

Type the new column order as a comma-separated list of 1-based column numbers in the 'Column order' field. For example, typing 3,1,2 on a 3-column file moves column 3 to the first position, column 1 to the second, and column 2 to the third.

Simply leave its column number out of the 'Column order' list. For example, on a 3-column file, typing 1,2 drops column 3 from the output entirely.

List its column number more than once. For example, typing 1,1,2 duplicates column 1 so it appears twice in the output, followed by column 2.

Comma, Tab, Semicolon, and Pipe are built in, and you can also enter any custom delimiter character of your choice.

Yes, the parser supports double-quoted fields that contain the delimiter character or escaped double quotes ("") inside them, so values like "Smith, John" are parsed correctly as a single field.

It only affects how the preview table displays the first row (as a bold header versus a regular data row). It does not change the reordering logic or the output data in any way.

Yes, a live preview table shows the first 5 rows of the reordered result as soon as you type a valid column order, so you can confirm it looks correct.

If a row doesn't have that many columns, the tool outputs an empty value for that position instead of causing an error.

Yes, a 'Download .csv' button saves the full reordered result using the same delimiter you selected (the file extension switches to .tsv automatically when Tab is selected).

No. All parsing, reordering, and preview generation happen entirely in your browser using JavaScript. Your data is never uploaded or stored on a server.

Yes, Swap CSV Columns is completely free, with no registration, file size restrictions beyond your browser's memory, or usage limits.

Our data tools