Tools

Home
JSON FormatterSQL FormatterJS ValidatorMinify CSS
Merge PDFCompress PDFImage to PDF
JPG to PNGPNG to WebPCrop Image

Swap CSV Columns

Select two columns in your CSV data and instantly swap their positions

Your files never leave your browser
CSV Input0 chars, 0 lines
Drag & drop a CSV file here, or browse
Accepts .csv, .tsv, .txt files
Output0 chars, 0 lines
Ready·

Pick two columns in any CSV file, hit swap, and the entire dataset rearranges in a second — headers included, quoted fields intact. The tool auto-detects commas, tabs, and semicolons so you don’t have to think about delimiters. And everything runs in your browser. Nothing gets uploaded.

How It Works

Paste or Upload CSV
→
Pick Two Columns
→
Swap & Download

The parser splits your CSV line by line, respecting quoted fields so commas inside values don’t cause problems. Once you pick Column A and Column B, every row gets those two values flipped. Headers move with their data. The output re-quotes any field that needs it, keeping the file valid for whatever you’re importing into next.

Examples

Fixing column order for a CRM import

Your export has First Name in column 1 and Email in column 3, but Salesforce expects Email first.

INPUT
First Name,Age,Email Alice,30,[email protected] Bob,25,[email protected]
OUTPUT
Email,Age,First Name [email protected],30,Alice [email protected],25,Bob

Reordering product data with quoted fields

Product descriptions contain commas, so they’re wrapped in quotes. The tool handles that without breaking anything.

INPUT
SKU,Description,Price A100,"Widget, large",29.99 B200,"Gadget, small",14.50
OUTPUT
Price,Description,SKU 29.99,"Widget, large",A100 14.50,"Gadget, small",B200

Tab-separated server logs

Auto-detects tabs as the delimiter. Swap Timestamp and IP columns so the IP comes first for your firewall analysis script.

INPUT
Timestamp IP Status 2024-01-15 192.168.1.5 200 2024-01-15 10.0.0.3 404
OUTPUT
IP Timestamp Status 192.168.1.5 2024-01-15 200 10.0.0.3 2024-01-15 404

Who Uses This

👨‍💻 Developers

Reorder CSV columns to match an API or database import schema without writing a script.

📊 Data Analysts

Fix column order in exports before loading them into BI tools like Tableau or Power BI.

📈 Marketers

Rearrange contact list columns so email platforms accept the upload on the first try.

🗃️ Database Admins

Align CSV column order with table schemas before running bulk inserts.

Common Mistakes

Selecting the same column twice

The tool will warn you if Column A and Column B are identical. Pick two different columns — otherwise there is nothing to swap.

Pasting data with mixed delimiters

If some rows use commas and others use tabs, the parser picks whichever delimiter appears most often. Clean up inconsistent delimiters before pasting, or the columns won’t line up right.

Forgetting the header row counts as a row

Headers get swapped too — that’s the correct behavior. But if your first row is actually data and not headers, the column dropdowns will show data values as labels. Not a bug, just something to be aware of.

Technical Details

Frequently Asked Questions

Does swapping columns change the data inside cells?

No. The cell values stay exactly the same — only their position in each row changes. Quoted fields, numbers, dates, and special characters all come through untouched.

Can I swap more than two columns at once?

One pair at a time. If you need to rearrange three or more columns, run multiple swaps. Each swap takes about a second, so even a few rounds is faster than doing it manually in a spreadsheet.

Is my CSV data sent to a server?

It is not. Everything runs in JavaScript inside your browser tab. No network requests, no server storage, no analytics on your file contents. Close the tab and the data is gone.

What if my CSV uses semicolons instead of commas?

The parser auto-detects the delimiter by scanning the first few rows. Semicolons, tabs, and commas are all supported. The output keeps whichever delimiter your original file used.

Can I use this tool on a phone or tablet?

Yes. The layout adjusts for smaller screens. You can paste CSV data or upload a file from your device. The swap and download buttons work the same way as on desktop.

Share: