Clean up CSV column headers
Headers written for people, like “Customer ID ”, “E-mail Address” or “Amount (EUR)”, are awkward for software. Spaces and brackets have to be quoted in SQL, break attribute access in pandas and confuse import mappers. Upload a file and SpreadsheetFix rewrites every header as lower-case snake_case, free and without uploading your data.
- Free up to
- 5,000 rows
- Account
- Not required
- Upload
- None
No file to hand?
Before and after
Customer ID ,First Name,E-mail Address,Amount (EUR),Sign-up Date 1001,Ana,ana@acme.io,120.00,2024-03-01 1002,Ben,ben@acme.io,85.50,2024-03-04
customer_id,first_name,e_mail_address,amount_eur,sign_up_date 1001,Ana,ana@acme.io,120.00,2024-03-01 1002,Ben,ben@acme.io,85.50,2024-03-04
How it works
- 1
Upload the CSV or Excel file whose headers need tidying.
- 2
SpreadsheetFix trims each header, lower-cases it, turns spaces and hyphens into underscores and drops other punctuation.
- 3
Check the new names in the preview and download. The data underneath is unchanged.
The rules it applies
Every header is trimmed and lower-cased, and each run of spaces or hyphens becomes a single underscore. Any remaining character that isn’t a–z, 0–9 or an underscore is removed, so brackets, slashes, # and % disappear: “Amount (EUR)” becomes amount_eur and “Sign-up Date” becomes sign_up_date. A header that ends up empty, such as one made only of symbols, is named column_ followed by its position, counting from 0.
Why snake_case
Lower-case names with underscores work unquoted in PostgreSQL, MySQL and SQLite, as attribute names in pandas (df.amount_eur), and as keys in JSON and most import tools. They also make column names predictable, so a script written against one month’s export keeps working on the next, even if someone added a trailing space or changed the capitalisation.
Accents and symbols are dropped, not translated
Characters outside a–z are removed rather than converted, so “Prénom” becomes prnom and “Größe” becomes gre. If your headers use accented letters, check the preview and rename those columns by hand after cleaning.
When not to rename
Some import templates, such as accounting or CRM imports, expect their own exact header names. If you’re preparing a file for one of those, leave this rule off and keep the template’s headers.
Questions
How do I clean column names in a CSV?
Upload the file above. Every header is rewritten as lower-case snake_case and you download the CSV with the new header row. Data rows aren’t touched.
Can I choose camelCase or kebab-case instead?
Not at the moment. The app always uses snake_case (customer_id), the most widely accepted style for databases and data tools.
What if two headers end up with the same name?
Rename one of them before cleaning. If “Price” and “PRICE” both become price, the column further to the right replaces the other one in the cleaned file.
Does it change my data?
No. Only the header row changes; every value stays in its column. Header cleaning runs after the other rules, so column choices you made on the original header names still apply.
Is header cleaning free?
Yes. Normalize Headers is a free rule for files up to 5,000 rows, with no account needed.