
camelCase
camelCase is a naming convention in which multiple words are joined together without spaces, with each new word starting with a capital letter. It is used primarily in programming languages, since names there cannot contain spaces.
In many computer programs, a name cannot contain a space. Otherwise the computer would not be able to tell where one name ends and the next begins. Yet names often need to consist of several words, for instance for a value like “last account balance”. camelCase solves this problem: the words are written directly one after another, and each additional word begins with a capital letter. “Last account balance” thus becomes lastAccountBalance. The name comes from the letters that stick up out of the word like the humps of a camel.
Why names without spaces still need to stay readable
A large part of a program consists of names. Names for values, for functions, for entire building blocks. If these names are illegible, no one can understand what the code does anymore. The difference between lastaccountbalance and lastAccountBalance seems small, but it is clearly noticeable when reading.
There is also a practical point: programs are rarely written by a single person. In large projects, dozens of developers work on the same code. If everyone uses their own notation, a patchwork results. That is why teams establish binding rules, often in what is called a style guide. camelCase is one of the most common conventions chosen there.
Another reason is searchability. Anyone searching the code for a name will only find it if the spelling matches exactly. Many programming languages, after all, distinguish strictly between uppercase and lowercase letters. AccountBalance and accountbalance are two completely different things to them.
The rule and its siblings
The rule itself is simple: the first word stays entirely lowercase, and every further word starts with a capital letter. Spaces and hyphens are dropped. “Number of users” becomes numberOfUsers, “save file” becomes saveFile. Abbreviations are handled differently depending on the style guide, for example httpRequest or hTTPRequest.
There are also several related notations. In PascalCase, the first word is also capitalized, giving LastAccountBalance. In snake_case, words are separated by underscores, and in kebab-case, by hyphens. These patterns often reveal at a glance which programming language someone is working in.
That’s because different languages have different conventions. JavaScript and Java predominantly use camelCase, while Python uses snake_case instead. These preferences are not technical requirements. The computer would accept any notation. They are purely conventions that developers adhere to so that unfamiliar code still looks familiar.
From program code to spreadsheets
Most commonly, one encounters camelCase in program code itself. Anyone who looks at a website and opens the source code will see names there like addEventListener or backgroundColor. Configuration files and data formats such as JSON also frequently use this notation. When an app exchanges data with a server, the fields within it usually carry camelCase names.
Outside of programming, this notation also appears in brand names. Examples include eBay, iPhone, or PayPal. Many people also rely on it in spreadsheets and file names, since spaces can cause problems there.
A common misconception is that camelCase is a requirement imposed by the programming language. That is not true. No program crashes because a name is written differently. The benefit lies solely with the people who later have to read and modify the code. And over the lifetime of a project, that involves far more people than were involved in writing it.