Text Case Converter
UpdatedWhat is the difference between camelCase and snake_case? camelCase joins words with capital letters (userName), snake_case joins them with underscores (user_name), and kebab-case uses hyphens (user-name). Follow the convention of the language: JavaScript uses camelCase, Python uses snake_case, and URLs use kebab-case. The converter below turns text into 11 cases at once, in your browser.
What is text case conversion?
Text case conversion is the act of transforming a string between casing conventions without changing the underlying word boundaries or meaning. The words stay; only how they are joined and capitalized changes. Our tool produces 11 conversions in parallel from a single input: UPPERCASE, lowercase, Title Case, Sentence case, camelCase, PascalCase, snake_case, kebab-case, dot.case, CONSTANT_CASE (also called SCREAMING_SNAKE_CASE) and Alternating case. Each output is a deterministic re-rendering of the same tokens. A short round-trip makes the relationship explicit. Starting with my variable name (or my_variable_name), the camelCase form is myVariableName, the PascalCase form is MyVariableName, the kebab-case form is my-variable-name, and the CONSTANT_CASE form is MY_VARIABLE_NAME. Five renderings, one set of words. It also splits at capital letters, so an existing name converts directly: getUserById becomes get_user_by_id, and an acronym run such as XMLHttpRequest becomes xml_http_request.
Naming conventions by language and context
Each ecosystem has settled on a small set of canonical cases, and mixing them inside a single layer reads as careless. The conventions worth memorizing are short.
- JavaScript and TypeScript: camelCase for variables and functions, PascalCase for classes and React components, SCREAMING_SNAKE_CASE for module-level constants like
MAX_RETRIES. - Python: snake_case for variables and functions, PascalCase for classes, SCREAMING_SNAKE_CASE for constants. PEP 8 codifies this, and linters such as pylint check names against it.
- CSS: kebab-case for class names and custom properties. A custom property declared as
--brand-coloris idiomatic;--brandColoris not. - URLs: kebab-case. Google's Search Central guidance recommends hyphens to separate words, because underscores can join words into one token, so
learn-typescriptreads as two words whilelearn_typescriptmay read as one. - Databases: snake_case is the SQL convention for tables and columns. Some teams override to camelCase for ORM compatibility, which is a defensible tradeoff but a documented one.
- Environment variables: SCREAMING_SNAKE_CASE by convention, the form POSIX uses for its own variable names. Windows treats names as case-insensitive, so
PathandPATHare the same variable there.
Common pitfalls
Three traps account for most of the case-conversion bugs we see in code review. The conversions themselves are deterministic, but the inputs and the surrounding style decisions are where the inconsistency creeps in. Naming each pitfall makes it cheap to avoid.
- Auto-converting acronyms inconsistently.
XMLHttpRequestbecomesxmlHttpRequestunder the modern camelCase convention, but a great deal of older code usesXmlHttpRequest. Both are defensible; mixing them inside one project is not. We pick one acronym policy per codebase and apply it across the whole tree. - Mixing kebab-case and snake_case in the same layer of a system. Kebab-case in URLs alongside snake_case in database columns is fine because the layers are separated by a clear boundary. Mixing the two inside a single layer breaks the pattern recognition that lets a reader skim a file and predict where to look next.
- Title Case capitalization rules. APA and the Chicago Manual of Style disagree on which short words get capitalized: APA capitalizes every word of four letters or more plus all major words, while Chicago lowercases articles, prepositions and coordinating conjunctions regardless of length. Our converter doesn't pick a side: its Title Case capitalizes the first letter of every word, so lowercase the small words by hand if your style guide asks for it. If the headline also has a character limit, paste the result into the word and character counter to check it.
When to use this tool
We reach for the converter in three concrete situations. The first is porting names between languages, for example turning Python's max_retry_count into JavaScript's maxRetryCount or a constant like MAX_RETRY_COUNT, which is faster than writing a regex for it. The same goes for JSON keys moving between a Python API and a JavaScript client: convert the key names here, then paste the payload into the JSON formatter to confirm it still parses. The second is a frontend engineer turning a label from a design document, say “Hero banner variant A”, into a component name like HeroBannerVariantA and a matching CSS class like hero-banner-variant-a. Both come from the same input, so the two stay aligned without retyping. The third is an editor normalizing UPPERCASE shouting in user-submitted content, where a reviewer pastes a comment, copies the Sentence case row, and ships the cleaner version back into the moderation queue.
Frequently asked
What's the difference between camelCase and PascalCase?
Both join words by capitalizing them; the difference is the first letter. camelCase starts lowercase (myVariableName) and PascalCase starts uppercase (MyClassName). In JavaScript and TypeScript, camelCase is for variables and functions and PascalCase for classes, types and React components, and in JSX the difference matters: a capitalized tag is treated as a component, a lowercase one as an HTML element.
Why does Google prefer kebab-case in URLs?
Google's URL guidance recommends hyphens to separate words, because underscores can join words into a single token. So learn-typescript reads as two words while learn_typescript may read as one. The advice has been consistent for years and is still in Google Search Central's URL structure documentation.
Should I use snake_case or camelCase in JavaScript?
camelCase. Python's PEP 8 uses snake_case for variables and functions, but JavaScript convention across the language, Node and npm is camelCase, so snake_case in a JS codebase usually means a port from Python or drifting style. SCREAMING_SNAKE_CASE (CONSTANT_CASE) is the exception, used for module-level constants such as MAX_RETRIES.
How does Title Case decide which words to capitalize?
Style guides disagree. APA capitalizes every word of four letters or more plus all major words, while Chicago lowercases articles, coordinating conjunctions and prepositions regardless of length. Our converter keeps it simple and capitalizes the first letter of every word, so lowercase small words such as "a", "of" and "the" by hand if your style guide requires it.
Can I convert all 11 cases at once?
Yes. Paste your text once and the tool shows all 11 versions side by side: UPPERCASE, lowercase, Title Case, Sentence case, camelCase, PascalCase, snake_case, kebab-case, dot.case, CONSTANT_CASE and Alternating case, each with its own copy button. That makes it easy to compare options when you have an identifier in one case and aren't sure which you need.
Sources: PEP 8 naming conventions · Google's URL structure guidance · POSIX environment variables. How we check our data