Change the Case of a CSV Column

Pick the columns, pick one of ten styles, and every value in those columns is rewritten: the lord of the rings to The Lord of the Rings, BLUE SHIRT to Blue Shirt, Order ID to order_id. It runs in your browser, so nothing is uploaded anywhere and the result appears as you change a control.

Renaming the columns instead of the values? The header cleaner does that.

A column with four people's typing habits in it

Case trouble in a data file is almost never one person's fault. A product catalog gets its first thousand rows from a migration script that lowercased everything. The next two hundred are typed by someone who holds shift for emphasis. A supplier feed arrives in full capitals because the supplier's system is thirty years old and thinks that looks official. Nothing is wrong with any individual row, and the column as a whole is unusable in a report.

The damage shows up in three places. Sorting puts Zebra before apple in anything that sorts by code point, which is most things. Grouping counts Blue Shirt and blue shirt as two products with half the revenue each. And a joined key that differs only in case fails to join at all, silently, leaving you with a smaller result set and no error message to explain it.

One pass over the column settles all three, as long as you pick a style deliberately rather than reaching for whatever the first dropdown offers.

Worked example: four titles, four different habits

Paste this in:

sku,title
A-1,the lord of the rings
A-2,BLUE SHIRT
A-3,order ID lookup
A-4,creme brulee kit

Tick title under Columns, leave Style on Title Case and Original column on Replace it:

sku,title
A-1,The Lord of the Rings
A-2,Blue Shirt
A-3,Order Id Lookup
A-4,Creme Brulee Kit

And the strip above it:

4 rows · Title Case applied to title · original replaced · 4 cells changed

Three of those four rows are exactly what you wanted. Row 1 is the interesting one: of and the second the stayed lowercase, which is what a person would have typed and what a naive implementation gets wrong. Row 3 is the one to be honest about. order ID lookup came back as Order Id Lookup, because Title Case capitalizes the first letter of a word and lowercases the rest of it, and there is no way for a general tool to know that ID was an acronym and Rings was not. If your column is full of acronyms, that matters, and a different style is the better answer.

The ten styles side by side

One value, order ID lookup, through every option in the Style dropdown:

lowercase        order id lookup
UPPERCASE        ORDER ID LOOKUP
Title Case       Order Id Lookup
Sentence case    Order id lookup
camelCase        orderIdLookup
PascalCase       OrderIdLookup
snake_case       order_id_lookup
kebab-case       order-id-lookup
CONSTANT_CASE    ORDER_ID_LOOKUP
iNVERT tHE cASE  ORDER id LOOKUP

Two of those behave differently from the rest and both are worth knowing about. lowercase and UPPERCASE do nothing but change letters, so punctuation, spacing and every non-letter character survive exactly as they were. That makes them the safe pair when you only want case-insensitive matching to start working and you do not want the value reshaped in any other way.

Sentence case also works on the raw string rather than on words. It lowercases the whole value and then lifts the first letter, plus the first letter after a full stop, a question mark or an exclamation mark. That is the entire rule. It cannot know that london was a city, so a free-text note that arrived shouting will come back readable but not perfectly capitalized. It is still a large improvement on a comment field full of capitals.

iNVERT tHE cASE flips every letter, uppercase to lowercase and back, character by character. It exists for the reason you would guess: someone left caps lock on. Running it over an accidentally shouted column that had normal capitalization underneath usually gives the original back.

Where the words are, and why it matters

The six remaining styles all start by cutting the value into words, and the boundaries they use are not obvious. Separators are the easy part: spaces, underscores, hyphens, dots and slashes all end a word. Case transitions matter too, so orderID is two words even with nothing between them. A run of capitals followed by a lowercase letter breaks before its last capital, which keeps ID whole in OrderIDNumber while still finding Number. And a digit next to a letter is a boundary.

Order ID       →  Order · ID
order_id       →  order · id
orderID        →  order · ID
OrderIDNumber  →  Order · ID · Number
order-id.v2    →  order · id · v · 2

That last line is the one that catches people out. v2 is two words, so order-id.v2 in snake_case is order_id_v_2 and not order_id_v2. Try the style on a handful of real values before you commit a whole column to it. The same splitter runs behind the header cleaner and the slug tool, so what you learn here transfers.

Picking a style on purpose

  • Title Case for anything a person will read: product names, city names, report labels, a column heading for a mail merge. Avoid it on a column dense with acronyms.
  • Sentence case for free-text notes, complaint descriptions and comment fields, which is where shouting lives.
  • lowercase before a join or a group-by. It is the cheapest way to make two systems agree about a key, and it destroys nothing else in the value.
  • snake_case or kebab-case when the value is about to become an identifier, a directory name or part of a URL path. For a real URL slug, the slugify tool handles accents and ampersands as well.
  • CONSTANT_CASE for enum values and status codes that a program will compare against a fixed list.
  • camelCase and PascalCase when the values are about to become keys or type names in generated code.

When the change is destructive and you want to check it, set Original column to Keep, add a new one. A title column converted to snake_case then gives you title_snake sitting beside it, the suffix taken from the style you chose, and you can eyeball the pair before deleting one of them.

Practical notes

  • Blank cells are left blank. They are counted separately in the summary rather than being turned into anything, so an empty note stays an empty note.
  • Nothing outside the ticked columns moves. The header row is untouched, and so is every column you did not tick. Ticking nothing falls back to the first column and says so in a warning.
  • Values are never reinterpreted. Cells are strings from read to write, so 007 stays 007, 1.50 keeps its trailing zero, and a date stays exactly as the file spelled it.
  • Accented letters keep their marks. This tool changes case only, so café in UPPERCASE is CAFÉ. If you need the accents removed, that belongs to the slug tool or the header cleaner.
  • The download never overwrites your file. A file called products.csv comes back as products-case.csv.
  • Nothing already correct is touched twice. If every value was already in the chosen case, the summary says zero cells changed and a note appears explaining why the table looks identical.

Frequently Asked Questions

Why did Order ID become Order Id in Title Case?

Because Title Case capitalizes the first letter of each word and lowercases the rest of it, so an acronym that was already uppercase loses its shape. This is a real limit rather than a bug being hidden: there is no reliable way to tell ID from Id in a column of free text. If a column is full of acronyms, UPPERCASE or leaving it as it is will serve you better than Title Case.

Does Title Case capitalize every word?

No. Short words in the middle stay lowercase, so "the lord of the rings" comes back as "The Lord of the Rings" and not "The Lord Of The Rings". The list is the conservative one that most style guides agree on: a, an, and, as, at, but, by, for, in, nor, of, on, or, per, the, to, v, via, vs. The first word is always capitalized whatever it is.

What is Sentence case for?

Rescuing text that was typed in capitals. It lowercases everything and then lifts the first letter of the value and the first letter after each full stop, question mark or exclamation mark, so "PAID LATE. NEEDS REVIEW." becomes "Paid late. Needs review." It does not know that London is a proper noun, so a shouted name will come back lowercase.

How is this different from the header cleaner?

This page rewrites the values in the rows and never touches the header. The header cleaner rewrites the first row and never touches the values. They share the same word splitter and the same case styles, so snake_case means the same thing on both, and it is normal to run one after the other.

Can I keep the original column?

Yes. Set Original column to "Keep, add a new one" and a second column appears beside it named after the style, so a title column converted to snake_case gives you title_snake next to title. The default here is "Replace it", because most people converting case want the column fixed rather than doubled.

What happens to empty cells and to numbers?

An empty cell stays empty and is counted separately in the summary. A value with no letters in it comes back byte for byte, so a price or a date is safe. Cells are strings from the moment the file is read to the moment it is written, which is why 007 is still 007 afterwards.

Can I convert more than one column at once?

Yes. Columns is a multi-select, and every column you tick gets the same style in one pass. Tick nothing and the first column is used, with a warning above the result telling you that is what happened.

Is anything uploaded?

No. The file is read and rewritten by JavaScript inside your own browser tab, and there is no upload endpoint on this page. That also means it works offline once the page has loaded, and a 100 MB file never crosses the network.

One column, one convention

Free, no account, no upload. Tick the columns, choose a style, take the CSV.

Back to the case converter