The team behind OnlineTools4Free — building free, private browser tools.
Published Apr 1, 2026 · 6 min read · Reviewed by OnlineTools4Free
Text Case Conversion: camelCase, snake_case & More
Why Case Conventions Matter
Naming conventions are one of the first things a new developer encounters and one of the last things they stop thinking about. The choice between getUserName, get_user_name, and get-user-name is not cosmetic — it signals which language, framework, or system you are working in.
Consistent casing improves readability. When every variable in a codebase follows the same pattern, developers can scan code faster because the visual structure is predictable. Mixed conventions force the reader to parse each name individually, which slows comprehension and increases the chance of typos.
Beyond code, case conventions matter in file naming, URL slugs, database columns, API field names, and configuration keys. Using the wrong convention can break functionality (CSS class names are case-sensitive, for example) or create confusion when interfacing between systems.
Common Case Styles
Here are the case conventions you will encounter most often:
- camelCase: First word lowercase, subsequent words capitalized. No separators. Used in JavaScript, Java, TypeScript, and Swift for variables and function names. Example:
firstName,getUserById. - PascalCase: Every word capitalized, no separators. Used for class names in most languages, React component names, and C# methods. Example:
UserProfile,HttpClient. - snake_case: All lowercase with underscores between words. Used in Python, Ruby, Rust, and database column names. Example:
first_name,get_user_by_id. - SCREAMING_SNAKE_CASE: All uppercase with underscores. Used for constants and environment variables across most languages. Example:
MAX_RETRIES,API_BASE_URL. - kebab-case: All lowercase with hyphens between words. Used in CSS class names, URL slugs, HTML attributes, and CLI flags. Example:
primary-button,user-profile. - Title Case: Every significant word capitalized. Used in headings, titles, and labels. Articles and prepositions are typically lowercase unless they are the first word. Example: "How to Convert Text Case".
- UPPERCASE / lowercase: The simplest transformations. Used for emphasis, identifiers, and normalization.
Conventions by Language and Context
Each programming language has established conventions, often formalized in style guides:
JavaScript / TypeScript: camelCase for variables and functions, PascalCase for classes and React components, SCREAMING_SNAKE_CASE for constants. The dominant style guide (Airbnb) enforces these strictly.
Python: snake_case for variables, functions, and methods. PascalCase for classes. SCREAMING_SNAKE_CASE for module-level constants. PEP 8 is the definitive reference.
CSS: kebab-case for class names and custom properties. BEM methodology uses a variation: block__element--modifier.
Go: PascalCase for exported identifiers, camelCase for unexported ones. The case of the first letter determines visibility — this is a language feature, not just a convention.
SQL: Conventions vary, but snake_case for table and column names is the most common. Keywords are often written in UPPERCASE by convention: SELECT first_name FROM users.
URLs: kebab-case is the SEO-recommended format for URL slugs. Search engines treat hyphens as word separators but not underscores, so /blog/text-case-guide is preferred over /blog/text_case_guide.
Converting Between Cases
Converting between cases manually is tedious and error-prone, especially for long strings or bulk text. The process involves splitting the input into words, then reassembling them with the target convention's rules.
For example, converting getUserProfile to snake_case requires identifying word boundaries (capital letters in camelCase), lowering everything, and joining with underscores: get_user_profile. Going the other direction requires splitting on underscores, capitalizing word starts, and joining without separators.
Edge cases abound: acronyms like "URL" or "API" can be tricky (parseURL vs. parseUrl), numbers in names require special handling, and consecutive uppercase letters need careful treatment.
Convert Text Case Online
Our Case Converter handles all common transformations: camelCase, PascalCase, snake_case, SCREAMING_SNAKE_CASE, kebab-case, Title Case, UPPERCASE, and lowercase. Paste or type your text, select the target format, and copy the result.
The tool correctly handles acronyms, numbers, and mixed-case input. It processes the conversion entirely in your browser with no server round-trip, so it works instantly even for large blocks of text. Whether you are renaming variables across a codebase, formatting headings, or preparing URL slugs, the converter saves minutes of manual work.
Case Converter
Convert text between uppercase, lowercase, title case, and more.
OnlineTools4Free Team
The OnlineTools4Free Team
We are a small team of developers and designers building free, privacy-first browser tools. Every tool on this platform runs entirely in your browser — your files never leave your device.
