Loading...
Loading...
Free online case converter. Convert text between camelCase, PascalCase, snake_case, kebab-case, and UPPER_CASE instantly.
Case conversion is a common need in programming and writing. Different programming languages, frameworks, and conventions use different naming styles. Converting between these formats saves time and prevents errors when migrating code between projects that follow different naming conventions.
camelCase (also called lower camel case) starts with a lowercase letter and capitalizes the first letter of each subsequent word. It is widely used in JavaScript, Java, and TypeScript for variable and function names. PascalCase is similar but starts with an uppercase letter — common for class names in most object-oriented languages.
snake_case uses underscores between words, all lowercase. It is the standard for Python variable/function names, Ruby symbols, database column names, and environment variables. UPPER_CASE (SCREAMING_SNAKE_CASE) is used for constants in most languages. kebab-case uses hyphens and is standard for URL slugs, CSS class names, and HTML data attributes.
The conversion between cases works by identifying word boundaries. For camelCase and PascalCase, each uppercase letter signals a new word. In snake_case and kebab-case, underscores and hyphens indicate boundaries. Converting from camelCase to snake_case requires inserting an underscore before each uppercase letter and converting to lowercase.
This converter handles five common formats: camelCase, PascalCase, snake_case, kebab-case, and UPPER_CASE. Each conversion runs in real-time as you type. Use it when adopting a new project's naming conventions, preparing API parameters, or ensuring consistent variable naming across your codebase.
camelCase starts with a lowercase letter (e.g., firstName, getData). PascalCase starts with an uppercase letter (e.g., FirstName, GetData). The term 'camelCase' gets its name from the humps created by uppercase letters; PascalCase refers to the Pascal programming language's naming convention.
Follow the convention of your programming language and framework. JavaScript/TypeScript uses camelCase for variables/functions and PascalCase for classes. Python uses snake_case for everything except classes (PascalCase). SQL uses snake_case for columns. CSS uses kebab-case for class names. Consistency within a project is more important than the specific choice.
Acronyms are a common challenge. For example, 'parseJSON' should convert to 'parse_json', not 'parse_j_s_o_n'. Most conversion logic treats consecutive uppercase letters as an acronym and keeps them together. Our converter follows this convention for accurate results.