Browse Definitions :
Definition

CamelCase

What is CamelCase?

CamelCase is a way to separate the words in a phrase by making the first letter of each word capitalized and not using spaces. It is commonly used in web URLs, programming and computer naming conventions. It is named after camels because the capital letters resemble the humps on a camel's back.

CamelCase is formally referred to as medial capitals. It may also be called or styled as PascalCase, camel case, InterCaps, mixedCase or WikiCase.

The first letter may or may not be capitalized in CamelCase. This difference is called UpperCamelCase and lowerCamelCase. PascalCase always has the first letter capitalized.

Uses of CamelCase

Many companies and technologies use CamelCase to create new words out of existing words that can be registered as trademarks. Some examples of these would be iPhone, AirDrop, DisplayPort, OneDrive, PlayStation, YouTube and TechTarget.

CamelCase naming convention examples
Some examples of the CamelCase naming convention used in company names, product names and programming

When a computer parses text, it treats the spaces as a delimiter between words. CamelCase is most used in places where white space is not allowed for technical reasons. This can make the phrase hard to read or ambiguous. An example of an ambiguous phrase in programming is chartable, which can be interpreted as char table (a table of characters) or chart able (having the ability to be charted). Other ways to remove white space are with dashes called kebab-case or with underscores with snake_case.

Website URLs often use CamelCase to replace spaces. Domain names cannot contain special characters and are not case-sensitive, so most websites write their domain name in CamelCase to make it easier to read and remember. If a space is present in a URL, it needs to use American Standard Code for Information Interchange percent encoding to replace it with %20, which is hard to read and type. Post tagging and #hashtags are often presented in CamelCase for easy readability. Emails may also be presented as CamelCase, such as [email protected]

CamelCase may be used in file names. While most file systems support spaces in file names, there are many reasons why CamelCase is popular. If a file is used on the internet URL, encoding the space in the file name may cause issues. Referring to file names or paths with a space in a command-line interface can be cumbersome and require the use of quotation marks. It is also important to note that some file systems are case-sensitive when referring to files.

CamelCase in computer programming

CamelCase is a popular convention in computer programming and variable names. Generally, variables can be any string of characters without white space. To keep them consistent and readable, it is best practice to establish variable naming conventions within an organization. Some examples of CamelCase variable names would be UserName, BirthDate, intUserAge and strUserName. Kebab-case is discouraged in many computer languages due to the dash being interpreted as a mathematical minus sign.

In some languages, CamelCase is encouraged in the developer documentation best practice. This can be specific to recommendations to using UpperCamelCase -- or PascalCase -- for some instances and lowerCamelCase for other. For example, naming conventions in Java recommend lowerCamelCase for variables, UpperCamelCase for classes and SCREAMING_SNAKE_CASE for constants.

naming conventions in Java
Explore naming conventions in Java programming.

Caution is required as some languages are case-sensitive. Depending on the language, userName and UserName may be interpreted as different variables or as the same one, causing errors. Java, Python and C are case-sensitive, while Basic and Pascal are not case-sensitive.

CamelCase may also be used in other instances such as Extensible Markup Language tags, domain name system names or Windows Active Directory names.

Explore the difference between kebab vs. CamelCase and CamelCase vs. snake case naming conventions.

This was last updated in July 2022

Continue Reading About CamelCase

Networking
  • routing table

    A routing table is a set of rules, often viewed in table format, that's used to determine where data packets traveling over an ...

  • CIDR (Classless Inter-Domain Routing or supernetting)

    CIDR (Classless Inter-Domain Routing or supernetting) is a method of assigning IP addresses that improves the efficiency of ...

  • throughput

    Throughput is a measure of how many units of information a system can process in a given amount of time.

Security
  • quantum key distribution (QKD)

    Quantum key distribution (QKD) is a secure communication method for exchanging encryption keys only known between shared parties.

  • Common Body of Knowledge (CBK)

    In security, the Common Body of Knowledge (CBK) is a comprehensive framework of all the relevant subjects a security professional...

  • buffer underflow

    A buffer underflow, also known as a buffer underrun or a buffer underwrite, is when the buffer -- the temporary holding space ...

CIO
  • benchmark

    A benchmark is a standard or point of reference people can use to measure something else.

  • spatial computing

    Spatial computing broadly characterizes the processes and tools used to capture, process and interact with 3D data.

  • organizational goals

    Organizational goals are strategic objectives that a company's management establishes to outline expected outcomes and guide ...

SearchHRSoftware
  • talent acquisition

    Talent acquisition is the strategic process employers use to analyze their long-term talent needs in the context of business ...

  • employee retention

    Employee retention is the organizational goal of keeping productive and talented workers and reducing turnover by fostering a ...

  • hybrid work model

    A hybrid work model is a workforce structure that includes employees who work remotely and those who work on site, in a company's...

Customer Experience
  • database marketing

    Database marketing is a systematic approach to the gathering, consolidation and processing of consumer data.

  • cost per engagement (CPE)

    Cost per engagement (CPE) is an advertising pricing model in which digital marketing teams and advertisers only pay for ads when ...

  • B2C (Business2Consumer or Business-to-Consumer)

    B2C -- short for business-to-consumer -- is a retail model where products move directly from a business to the end user who has ...

Close