HomeGuidesHow to Rename Column Headers in a CSV File
Guide

How to Rename Column Headers in a CSV File

3 methods — browser tool, Excel, and Python

Renaming CSV column headers is one of the most common data prep tasks before importing into a CRM, database, or analytics tool. The target system expects specific field names, and your export rarely matches them out of the box.

Method 1: Using Tabular (browser, no software)

  1. 1Go to the Rename Columns tool on Tabular.
  2. 2Upload your CSV or XLSX file.
  3. 3Your current column headers are shown — type the new name for each column you want to rename.
  4. 4Leave columns blank to keep their existing names.
  5. 5Click Run and download the result.

Rename columns to match your import target's exact expected names — for example, HubSpot expects 'First Name' and 'Email', Salesforce expects 'FirstName' and 'Email'.

Method 2: Using Excel

  1. 1Open your CSV in Excel.
  2. 2Click the cell containing the header you want to rename (row 1).
  3. 3Type the new header name and press Enter.
  4. 4Repeat for each column.
  5. 5Save as CSV via File > Save As.

For large files with many columns to rename, the Python method is much faster than clicking each cell individually.

Method 3: Using Python (pandas)

  1. 1Install pandas: pip install pandas
  2. 2Run the script below.

python

import pandas as pd

df = pd.read_csv("input.csv")

# Rename specific columns
df = df.rename(columns={
    "old_name_1": "new_name_1",
    "old_name_2": "new_name_2",
    "Email Address": "Email",
})

# Or rename all columns at once with a list (must match column count)
# df.columns = ["Name", "Email", "Phone", "Company"]

df.to_csv("output.csv", index=False)

Frequently asked questions

Why do I need to rename CSV column headers?

Import targets like CRMs, databases, and analytics tools require column names to exactly match their expected field names. For example, Salesforce expects 'FirstName' not 'First Name', and Mailchimp expects 'Email Address' not 'email'. Renaming before import prevents mapping errors.

How do I rename all columns to lowercase?

In pandas: df.columns = df.columns.str.lower(). To also replace spaces with underscores: df.columns = df.columns.str.lower().str.replace(' ', '_'). This is useful for database imports which typically require lowercase snake_case column names.

Can I reorder columns at the same time as renaming them?

In Tabular, use the Reorder Columns tool after renaming. In pandas, combine both operations: df = df.rename(columns={...})[['col1', 'col2', 'col3']] to rename and select columns in a specific order in one step.

How do I remove special characters from column names?

In pandas: df.columns = df.columns.str.replace(r'[^a-zA-Z0-9_]', '_', regex=True). This replaces spaces, parentheses, slashes, and other special characters with underscores — useful before loading into a database.

Ready to try the fastest method?

Rename any column header in your CSV or XLSX file. Map old names to new ones before importing to another system.

Rename Columns — free