Naming Conventions by Language
Every programming language and ecosystem has settled on preferred naming conventions. Using the wrong case in a codebase does not just look inconsistent — it can break tooling, confuse collaborators, and violate linter rules that block your commits.
- camelCase — the default in JavaScript, TypeScript, and Java for variables and function names. The first word is lowercase; every subsequent word is capitalized:
getUserName. - snake_case — preferred by Python (PEP 8), Ruby, Rust, and most SQL dialects:
get_user_name. - PascalCase — used for class names in C#, Java, and TypeScript, and for React component names:
GetUserName. - kebab-case — the standard for CSS class names, HTML attributes, URL slugs, and CLI flags:
get-user-name. - CONSTANT_CASE — reserved for environment variables, compile-time constants, and enum values across most languages:
MAX_RETRY_COUNT.
Knowing which convention belongs where saves time during code reviews and keeps your project consistent without relying on memory alone.
When Case Conversion Matters
Case conversion is not just a cosmetic preference. It comes up in several practical scenarios that developers encounter daily.
- API field mapping — A JSON response from a Ruby backend uses
snake_casekeys, but your React frontend expectscamelCase. Automated conversion at the boundary layer keeps both sides idiomatic. - Database column naming — PostgreSQL folds unquoted identifiers to lowercase, so
snake_caseis the safest choice for column names. Migrating from a camelCase ORM schema means bulk-converting every column. - URL slug generation — Titles like "How It Works" need to become
how-it-worksfor clean, SEO-friendly URLs. Kebab-case is the universal standard for URL paths. - Code style enforcement — Linters like ESLint (
camelcaserule), Pylint, and RuboCop flag incorrect casing as errors. Converting identifiers before pasting code into a new project avoids a wall of lint warnings. - Environment variables — Shell conventions dictate
CONSTANT_CASEfor exported variables. Converting a config key likedatabaseUrltoDATABASE_URLis a one-step operation with this tool.
The 14 Cases This Tool Supports
This converter handles every mainstream naming convention plus several utility transforms. Given the input hello world example, here is what each case produces:
- camelCase —
helloWorldExample. First word lowercase, subsequent words capitalized, no separator. - PascalCase —
HelloWorldExample. Every word capitalized, no separator. - snake_case —
hello_world_example. Words joined with underscores. - CONSTANT_CASE —
HELLO_WORLD_EXAMPLE. All uppercase with underscore separators. - kebab-case —
hello-world-example. Words joined with hyphens. - Train-Case —
Hello-World-Example. Capitalized words joined with hyphens, common in HTTP headers. - Title Case —
Hello World Example. Every word capitalized, separated by spaces. - Sentence case —
Hello world example. Only the first word capitalized. - dot.case —
hello.world.example. Words joined with dots, used in Java package names and property files. - path/case —
hello/world/example. Words joined with forward slashes, useful for file paths and routes. - no case —
hello world example. Plain lowercase words separated by spaces. - sWaP cAsE — inverts the case of every character.
HellobecomeshELLO. - UPPER CASE —
HELLO WORLD EXAMPLE. The entire string in uppercase. - lower case —
hello world example. The entire string in lowercase.
The tool tokenizes your input by splitting on camelCase boundaries, underscores, hyphens, dots, slashes, and spaces — so you can paste text in any existing format and convert it to any other in one click.
Unicode and Locale Considerations
Case conversion looks simple until you encounter non-ASCII text. The most well-known pitfall is the Turkish I problem: in Turkish, the uppercase form of i is not I but İ (Latin capital I with a dot above), and the lowercase form of I is ı (dotless i). A naive toUpperCase() call using the default locale can silently corrupt identifiers if the browser or OS locale is set to Turkish or Azerbaijani.
German presents another edge case: the lowercase letter ß (Eszett) traditionally had no uppercase form and was uppercased as SS, changing the string length. Since 2017, Unicode includes the capital Eszett ẞ, but browser behavior varies.
This tool uses JavaScript's built-in toUpperCase() and toLowerCase() with the browser's default locale, and its tokenizer uses Unicode-aware regex patterns (\p{L}, \p{Lu}, \p{Ll}) so accented characters and non-Latin scripts are handled correctly during word splitting. For programming identifiers you will typically work with ASCII text where these locale issues do not apply, but it is worth knowing about them when processing user-facing strings.
Related Tools
If you are working with text transformation, these other CodeBoxTools utilities may help:
- Slug Generator — converts titles and sentences into URL-safe slugs, handling Unicode transliteration and duplicate-slug suffixes.
- JSON Formatter — paste minified JSON and get a pretty-printed, syntax-highlighted view. Useful when you need to inspect API payloads before converting their keys to a different case.
- Diff Checker — compare the original and converted versions of a file side by side to verify that only the intended casing changes were made.