π€ Case Converter
Convert text between different casing styles. Runs entirely in your browser.
Text Case Styles in Programming β When and Where to Use Each Naming Convention
Consistent naming conventions are a cornerstone of clean, maintainable code. Different programming languages, frameworks, and contexts have established conventions for how identifiers (variables, functions, classes, constants) should be cased. Using the wrong convention makes code harder to read and violates linting rules.
Programming Case Styles Reference
- camelCase β First word lowercase, subsequent words capitalized. Used for JavaScript/TypeScript variables and functions, Java methods, JSON property names. Example:
getUserProfile,isActive. - PascalCase β Every word capitalized. Used for class names in most languages, React/Vue/Angular components, C# methods and properties, TypeScript interfaces. Example:
UserProfile,HttpClient. - snake_case β Words separated by underscores, all lowercase. Used for Python variables and functions, Ruby methods, database column names, PostgreSQL/MySQL conventions. Example:
user_profile,created_at. - kebab-case β Words separated by hyphens, all lowercase. Used for CSS class names, URL slugs, HTML attributes, npm package names, CLI flags. Example:
user-profile,font-size. - CONSTANT_CASE β All uppercase with underscores. Used for environment variables, constants, enum values, preprocessor macros. Example:
MAX_RETRIES,API_BASE_URL. - UPPER CASE β All characters uppercase. Used for acronyms, headings, and emphasis.
- lower case β All characters lowercase. General-purpose text normalization.
- Title Case β First letter of each word capitalized. Used for headings, titles, and UI labels.
When to Convert Between Case Styles
- API integration β Convert between camelCase (JavaScript) and snake_case (Python/database) when mapping JSON payloads to database schemas
- Code refactoring β Rename variables or files to match your project's linting rules (ESLint, Pylint, RuboCop)
- URL slug generation β Convert titles to kebab-case for SEO-friendly URLs
- Database migration β Convert column names between conventions when switching ORMs or databases