Skip to main content

CSV Column Rename

Change CSV header names while preserving all values and column order, then retrieve the updated file directly in your browser.

  • Clipboard

Embed this widget

Customize the result, check the live preview, then copy the code.

Preview

Embed code type

Code to copy

Responsive and automatically resized by Bethemesh.

One rename per line: old => new

Was this tool useful?

How does this tool work?

A contact, product or invoice import may fail because its column names differ from the receiving application's field names. Renaming CSV columns adapts that first record without retyping data or moving fields. Apply several mappings together: an internal reference can become a clear identifier, while an amount can receive a heading that states its currency. Cell values remain unchanged text, including leading zeros and decimal punctuation. This is useful when the information already matches the destination schema and only its labels need changing.

The first logical record is always the header; there is no setting for a file without headings. Delimiter detection considers commas, semicolons, tabs and vertical bars, counting occurrences outside quoted fields in that record. Quoted fields may include delimiters and line breaks. A doubled quotation mark represents a literal quote inside a quoted field. An unclosed quote prevents the operation. A leading UTF-8 BOM is removed when reading the source.

Write one old => new mapping per line. Spaces around both entered names are removed. The option to ignore spaces in headers is initially enabled and also trims the source heading before matching it. Matching remains case-sensitive and accent-sensitive: Code and code are different names. With the option disabled, a heading surrounded by spaces will no longer match the simplified name entered in the mapping list. The option does not trim any data cells.

Mappings operate simultaneously on the original headings. Consequently, a => b together with b => c produces b and c, rather than renaming the first column twice. Unmatched headings remain untouched, and an empty replacement is ignored. Duplicate destination names are allowed and the CSV retains their cells; software expecting unique object properties may subsequently handle those headings differently. Output keeps the detected delimiter, quotes fields where necessary and uses LF line endings. It preserves cell values rather than reproducing the original file byte for byte.

How to use this tool

  1. Supply the CSV and its headings

    Paste the table or import a CSV or TSV text file. Check that the first record contains the headings to replace, rather than an introductory comment above the actual table.

  2. Enter the required mappings

    Put each mapping on its own line and use the exact => separator. Check capitals, accents and destination names. Keep header trimming enabled when the source export has unwanted surrounding spaces.

  3. Inspect the resulting header

    Run the rename operation, compare the output headings with the receiving schema, then copy or export the CSV. The count measures matched columns, even when a replacement repeats the existing name.

Use cases

Prepare a stock-system import

Match a supplier's column labels to the field names required by your inventory application while retaining the supplier's product references exactly as text.

Make an amount's unit clear

Replace price with price_gbp in a product catalogue so readers know the currency. Renaming the heading does not perform a currency conversion.

Agree on an exchange schema

Apply a mapping agreed with a partner before merging exports whose columns genuinely represent the same information but currently have different labels.

Examples

Label a reference and its currency

Two headings change. The decimal point in 12.50 remains a point and B04 retains its zero. No calculation or type conversion takes place, and the two products keep their original order.

Input

ref;price
A17;12.50
B04;8.00
Mappings: ref => reference; price => price_gbp

Result

reference;price_gbp
A17;12.50
B04;8.00

Match a heading surrounded by spaces

The original heading has a space before and after code. Ignoring surrounding spaces lets the mapping match without changing city or York. Disabling that option would leave the spaced heading unchanged.

Input

 code ;city
C3;York
Mapping: code => identifier; ignore header spaces enabled

Result

identifier;city
C3;York

Tips and best practices

  • Choose unique destination headings when the next application turns rows into JSON objects. The rename operation itself permits repeated headings and does not decide how another importer resolves them.
  • Entering the same source name again replaces its earlier mapping in the list. Consolidate your choices so an obsolete mapping does not accidentally become the last instruction for that name.
  • Import size depends on the upload control and available browser memory. For a large export, first try a representative copy containing quoted fields, decimal values and accented characters.

Frequently asked questions

Does a mapping fail if its original column is missing?

No. It has no effect and does not increase the count. If none of your headings changes, check the source spelling, letter case and surrounding-space option before editing the data rows.

Can I rename columns that already have identical headings?

Yes. Every matching occurrence receives the replacement and all cells remain present. A single mapping by heading cannot give different replacement names to individual occurrences of the same heading.

Can a replacement heading contain a comma?

Yes. The serializer quotes a heading containing the detected delimiter, a quotation mark or a line break. A comma alone does not require quoting in a semicolon-delimited file.

Does renaming sort or clean my records?

No. It replaces only matching header cells, with processing performed in your browser. Use CSV column selection when you need to remove columns or arrange them in a different order.

Related tools

Tools similar or complementary to this one.

Similar tools

Select the CSV columns you want to keep in the final result.

Data & spreadsheetsUse this tool

Merge multiple CSV files into one table while keeping columns aligned consistently.

Data & spreadsheetsFeaturedUse this tool

Validate CSV structure and quickly identify problematic rows or columns in your data.

Data & spreadsheetsFeaturedUse this tool
GuideBest practicesBeginner

Split a CSV or Excel table into smaller files

Discover when to split a large table by row count or by a column value, and how to preserve a useful structure in every output file.

29 August 20261 min