csvkit.org
CSV (Comma-Separated Values) utilities, in the browser
Say hi →

CSV Header Row

add · remove · rename · promote row N · snake_case · de-duplicate

Fix the first line of a CSV. Add column names to a headerless export, drop a header a database importer doesn't want, rename columns in bulk, or promote the real header when the file starts with junk rows from a report generator. Duplicate and blank names are resolved automatically, and you get a before/after mapping table.

header row
Or drop a .csv file here, or
ready

How to edit a CSV header row

  1. Paste the CSV or drop a file.
  2. Pick an action: add for a file whose first line is already data, remove to strip names off, rename to replace them, promote row N when the header sits below a title or blank rows.
  3. For add and rename, type the new names comma-separated. Leave a position blank to keep the existing name, or leave the whole field blank to get column_1 … column_n.
  4. Optionally normalise the names to snake_case, camelCase, or Title Case, then copy or download.

What it cleans up automatically

Why "promote row N" exists

Exports from BI tools and accounting systems often start with a report title, a date, and a blank line before the real column names. Every parser then treats that title as the header and everything after it as one-column garbage. Setting N to the line that actually holds the names discards everything above it and keeps the rest as data.

FAQ

How do I add a header to a CSV without one?

Choose add a header row and type the names. The tool matches the file's column count, filling any names you don't supply with column_n.

Can I reorder or delete columns here too?

That's Keep / rename / reorder, which gives you a per-column list with checkboxes and move buttons.

Does renaming break the data rows?

No. Only the first line changes; data rows are re-emitted unchanged apart from standard CSV re-quoting.

My header has a weird invisible character at the start.

That's a byte-order mark. Encoding & BOM removes it, and Repair CSV does too as part of its pass.

Privacy

100% client-side. No upload. See the privacy policy.