Menu

Case Converter

Convert text between camelCase, snake_case, kebab-case, and more.

Last updated

Input4 words
OutputClick any value to copy
  • camelCasehelloWorldFromCoddy
  • PascalCaseHelloWorldFromCoddy
  • snake_casehello_world_from_coddy
  • CONSTANT_CASEHELLO_WORLD_FROM_CODDY
  • kebab-casehello-world-from-coddy
  • Train-CaseHello-World-From-Coddy
  • dot.casehello.world.from.coddy
  • path/casehello/world/from/coddy
  • Sentence caseHello world from coddy
  • Title CaseHello World From Coddy
  • UPPERCASEHELLO WORLD FROM CODDY
  • lowercasehello world from coddy

What is a case converter?

A case converter takes a phrase or identifier and rewrites it in every common naming style — camelCase, PascalCase, snake_case, kebab-case, CONSTANT_CASE, Title Case, Sentence case, and more. Developers reach for it constantly: refactoring variable names, generating database column names, writing API field names that match a style guide, and turning user-entered text into URL slugs.

Different ecosystems prefer different cases. JavaScript and Java like camelCase; Python and Ruby like snake_case; CSS classes and URLs use kebab-case; environment variables and constants use CONSTANT_CASE. A case converter lets you flip a phrase into the right style without doing it character-by-character in your head.

The hard part isn't the rewriting — it's the *tokenizing*. A case converter has to split mixed input like XMLHttpRequest, iOSDevice, or read_HTML5Tags into the right words first, then re-join them in the chosen style. Smart tokenizers handle acronyms (XML, iOS) and digits gracefully.

What you'll learn while converting cases

  • Each language community has its preferred style. Match the convention of the codebase you're writing in.
  • Tokenization splits mixed input on capitals, separators (_ - .), and digit boundaries before re-joining.
  • Acronyms make case conversion ambiguous: should XMLParser round-trip as xmlParser or xMLParser? Pick the convention your codebase uses and stay consistent.

How to convert text case step by step

  1. Paste your text

    Drop in a single phrase, an identifier, or a whole list. Mixed input — camelCase, snake_case, spaces — is fine.

  2. Read every variant at once

    The converter shows the input rewritten in 10+ cases. Pick the one your codebase uses.

  3. Tweak edge cases

    Toggle handling of acronyms, digits, and special characters if your style guide has specific rules.

  4. Click to copy

    Click any variant to copy it to your clipboard. Useful when refactoring across files or filling in OpenAPI specs.

Naming styles quick reference

How the same phrase looks across the most common naming conventions.

StyleExampleWhere it's used
camelCaseuserNameJavaScript variables, Java methods
PascalCaseUserNameClass names in most languages, React components
snake_caseuser_namePython, Ruby, database columns
SCREAMING_SNAKE_CASEUSER_NAMEConstants, environment variables
kebab-caseuser-nameURLs, CSS classes, shell flags
Title CaseUser NameHeadings, labels
Sentence caseUser nameUI copy, prose
Train-CaseUser-NameHTTP headers (X-Request-Id)
dot.caseuser.nameConfig keys, namespaced settings
flatcaseusernameDomain names, package slugs

Case conversion examples to try

Convert a phrase

Input

user profile photo

Variants

camelCase: userProfilePhoto · PascalCase: UserProfilePhoto · snake_case: user_profile_photo · kebab-case: user-profile-photo · CONSTANT_CASE: USER_PROFILE_PHOTO

Same words, five styles. Pick the one that matches the file you're editing.

Refactor a JS variable into Python

JavaScript
const accessTokenExpiresAt = ...;
Python
access_token_expires_at = ...

Most teams keep one canonical name in their domain model and translate it at the boundary between languages or between API layers.

Slugify a title for a URL

Title

10 Best Practices for REST APIs

Slug

10-best-practices-for-rest-apis

Slugs are kebab-case + lowercase + safe characters only. They double as URL segments and CSS class names.

Common case conversion mistakes

  • Mixing styles inside the same file or layer (userName, user_name in the same module). Pick a style and enforce it with a linter.
  • Capitalizing acronyms inconsistently (XmlParser vs XMLParser). Decide once per codebase and stick with it.
  • Forgetting that database identifiers are sometimes case-folded — userName and username may be the same column on PostgreSQL but different on MySQL.

Case Converter FAQ

What is camelCase?
camelCase capitalizes every word except the first and joins them with no separators (accessTokenExpiresAt). It's the dominant style for variables and methods in JavaScript and Java.
What is snake_case?
snake_case lowercases every word and joins them with underscores (access_token_expires_at). It's idiomatic in Python, Ruby, and most relational database column names.
What is the difference between PascalCase and camelCase?
Both capitalize each subsequent word. The difference is the first letter — PascalCase capitalizes it (UserProfile), camelCase does not (userProfile). PascalCase is reserved for class names and React components in most ecosystems.
How do I convert text to a URL-safe slug?
Lowercase, replace spaces and underscores with hyphens, strip accents (ée), and remove characters that aren't letters, digits, or hyphens. Most case converters offer a slugify mode that does all of this in one step.
Should I use camelCase or snake_case in my project?
Match the language: camelCase for JavaScript, Java, Swift; snake_case for Python, Ruby, Rust. Inside a codebase, consistency matters more than the specific choice — a linter (ESLint, Pylint, Rubocop) will keep it enforced.

Learn more

Other developer tools

Learn to code with Coddy

GET STARTED