Tools Hub

Swap Columns

Swap two columns in delimited text, row by row, with an optional header.

Browser onlyYour data never leaves this device.

Runs entirely in your browser. Your text never leaves this device and is never stored.

Details: Privacy policy

Input

One row per line; the header is optional.

Result

No text yet.

Paste delimited text above and choose two columns.

Swap Columns exchanges two columns in delimited text without touching anything else. It is the repair for exports that arrive in the wrong order: first and last names reversed, currency before the amount, or a legacy system that puts the identifier in the third field while everything else expects it in the first. You choose the delimiter, the two 1-based column numbers and whether the first row is a header. The page states exactly what it will not do. Splitting is literal, so a delimiter inside quotes still separates cells; a row that lacks either column is left exactly as it was and counted, rather than padded with blanks that would invent data; and a column number beyond the widest row is refused with the real column count. The output keeps every other character in place, uses the same delimiter, and reports how many rows were swapped and how many were left alone. Empty source lines are skipped. Caps are explicit at one hundred columns and five thousand rows. Everything runs locally in your browser, and nothing is uploaded or stored. The delimiter is reused exactly as typed, so the output can be pasted back into the same system.

How to use Swap Columns

  1. Paste the delimited text and choose the delimiter.
  2. Set the two column numbers and whether the first row is a header.
  3. Copy the swapped text or clear to start over.

What you get

  • The same rows with the two chosen columns exchanged in each complete row.
  • Counts of swapped rows and rows left unchanged because a column was missing.
  • The original delimiter and header row preserved, ready to copy.

When to use Swap Columns

  • Put first names before last names in an export that reversed them.
  • Move an amount column ahead of its currency column for an import.
  • Correct a two-column ordering mistake without editing every row by hand.

Frequently asked questions about Swap Columns

What happens to rows with missing columns?

They are left exactly as they were and counted in the result. The tool never pads a short row, because that would invent values that were not in your data.

Is the header row swapped too?

Not when the header option is ticked. The first non-empty row is kept verbatim so the column names stay above the data they describe.

Does it support quoted CSV fields?

No. Splitting is literal: a delimiter inside quotes still separates cells. Use a dedicated CSV parser if quoting matters.

Is my text uploaded?

No. The swap runs in your browser; nothing is sent to a server or stored after the page closes.

Guides that compare Swap Columns

⚡Embed Swap Columns on Your Site & Get Badge↓

Embed this in-browser tool into any blog, documentation, or dashboard. Includes an optional dofollow backlink badge to credit Tools Hub.

Height:
<iframe src="https://salaq.com/embed/text/swap-columns" title="Swap Columns — Tools Hub" width="100%" height="640" style="border:0;border-radius:12px;overflow:hidden;max-width:100%;" loading="lazy"></iframe>
<p style="font-size:12px;color:#6b7280;margin-top:6px;font-family:system-ui,-apple-system,sans-serif;">Powered by <a href="https://salaq.com/tools/text/swap-columns" target="_blank" rel="noopener" style="color:#2563eb;text-decoration:underline;">Swap Columns on Tools Hub</a></p>

Feedback

Send feedback about this tool (placeholder — feedback collection is not wired up yet).