Skip to content
Yantrakosha
Development

Developer Naming Conventions Guide — camelCase, snake_case, and When to Use Each

Sunil Kalikayi3/7/20267 min read

camelCase — JavaScript, Java, and TypeScript

Variables and functions in JavaScript use camelCase: `myVariableName`, `getUserData`, `isLoading`. Converting from other formats? Use the snake_case to camelCase or kebab-case to camelCase converter.

snake_case — Python, Ruby, and Databases

Python's PEP 8 mandates snake_case for functions and variables: `user_name`, `get_user_data`. Database column names also commonly use snake_case. Convert from JS naming with the camelCase to snake_case converter.

PascalCase — Classes and Components

Class names in most languages and React components use PascalCase: `UserProfile`, `HttpClient`, `DataManager`. Convert from snake_case with snake_case to PascalCase or from camelCase with camelCase to PascalCase.

kebab-case — CSS, URLs, and File Names

CSS class names, URL slugs, and many config files use kebab-case: `main-content`, `user-profile`, `api-response`. Convert with camelCase to kebab-case or snake_case to kebab-case.

CONSTANT_CASE and Others

Environment variables and constants use CONSTANT_CASE: `API_KEY`, `MAX_RETRIES`, `DATABASE_URL`. Some config systems use dot.case: `app.config.database`. Quick tip: the UPPERCASE converter and lowercase converter handle simple text transforms.

How to Choose Without Overthinking It

If you are in application code, follow the language convention first. If you are naming CSS, URLs, or file paths, pick the convention that keeps the output readable and predictable. The key is consistency within the project, not chasing a single universal style.

Frequently Asked Questions

Convert names to the right case

Open FreeTextKit Case Converter to switch naming styles quickly while you refactor, document, or clean up config.

Open Case Converter
Recommended next tools

A few strong starting points across Yantrakosha.