🔠 Text Case Converter
Convert text between camelCase, PascalCase, snake_case, kebab-case, and CONSTANT_CASE instantly.
Results
| Case Type | Result | Action |
|---|---|---|
| camelCase | |
|
| PascalCase | |
|
| snake_case | |
|
| kebab-case | |
|
| CONSTANT_CASE | |
What Are Naming Conventions?
Naming conventions are rules for formatting identifier names (variables, functions, classes, files) in source code. Consistent naming improves code readability, reduces bugs, and makes collaboration easier across teams. Different programming languages and ecosystems have adopted specific conventions as their standards.
Case Styles Explained
| Style | Pattern | Example | Common Use |
|---|---|---|---|
| camelCase | First word lowercase, subsequent capitalized | getUserName | JavaScript variables/functions, Java methods, TypeScript |
| PascalCase | Every word capitalized | GetUserName | C# classes/methods, .NET, Java classes, React components |
| snake_case | Words separated by underscores, all lowercase | get_user_name | Python, Ruby, Rust, SQL, file names |
| kebab-case | Words separated by hyphens, all lowercase | get-user-name | CSS classes, HTML attributes, URL slugs, CLI flags |
| CONSTANT_CASE | All uppercase with underscores | GET_USER_NAME | Constants, environment variables, macros |
How to Use This Tool
- Type or paste any text, identifier, or phrase into the input field.
- Click Convert to see the text in all five case styles simultaneously.
- Click Copy next to the style you need to copy it to your clipboard.
Common Use Cases
- Cross-language development: Convert a Python
snake_casefunction name tocamelCasefor a JavaScript API client. - API design: Ensure JSON property names follow your team's chosen convention (camelCase for JS clients, snake_case for Python clients).
- CSS class naming: Convert PascalCase component names to kebab-case for CSS selectors.
- Database to code mapping: Convert SQL column names (
snake_case) to C# property names (PascalCase). - Environment variables: Convert config key names to
CONSTANT_CASEfor environment variables.
Frequently Asked Questions
Follow the conventions of your programming language and team style guide. JavaScript
uses camelCase for variables and PascalCase for classes. Python and Ruby use snake_case.
C# uses PascalCase for public members and camelCase (with underscore prefix) for private
fields. CSS uses kebab-case. Consistency within a project matters more than the specific
choice.
Most programming languages interpret the hyphen (
-) as a minus operator,
so my-variable would be parsed as my minus variable.
Kebab-case works in CSS, HTML attributes, file names, and URL slugs because these
contexts don't treat hyphens as operators. Lisp/Clojure are notable exceptions that
allow hyphens in identifiers.
Title Case (capitalizing every major word) and Sentence case (capitalizing only the
first word) are text formatting conventions used in writing, not programming identifiers.
This tool focuses on the five most common code naming conventions. For general text
formatting, word processors and writing tools are more appropriate.