ToolNimba

๐Ÿ”ค Case Style Converter: camelCase, snake_case, kebab-case

Shihab Mia By Shihab Mia ยท Updated 2026-06-28

Word boundaries are detected from spaces, underscores, hyphens, dots and camelCase humps.

Type something above to see every case style.

This case style converter rewrites any word, phrase or identifier into the naming conventions developers use every day: camelCase, PascalCase, snake_case, kebab-case, CONSTANT_CASE and Title Case. Paste a variable name like getUserProfile or a plain phrase like "user profile id" and you get all six styles at once, each with a copy button. It detects word boundaries from spaces, underscores, hyphens, dots and camel humps, so you can convert in any direction without retyping.

What is the Programming Case Converter?

A case style converter solves a small but constant problem in programming: the same set of words has to be written a dozen different ways depending on where it lives. A "case style" (also called a naming convention) is simply a rule for joining several words into one identifier when a language will not allow spaces inside a name. The differences between styles come down to two things only: which separator joins the words, and which letters are capitalised. Everything else is the same set of words. That is why a good case style converter can show you every variant of a name side by side and let you copy the one you need in a single click.

The six styles this case style converter produces cover almost every situation you will meet. camelCase joins words with no separator and capitalises every word except the first, so getUserProfile becomes the standard form for JavaScript and Java variables. PascalCase, also called UpperCamelCase, capitalises the first word too (GetUserProfile) and is used for classes, types and React components. snake_case lowercases everything and joins with underscores (get_user_profile), the convention for Python and Rust functions and for SQL database columns. kebab-case lowercases and joins with hyphens (get-user-profile) and powers CSS class names, URL slugs and command-line flags. CONSTANT_CASE, sometimes written SCREAMING_SNAKE_CASE, uppercases everything and joins with underscores (GET_USER_PROFILE) for constants and environment variables. Title Case keeps the spaces and capitalises each word (Get User Profile) for headings and labels.

The genuinely hard part of any case style converter is not swapping the separator, it is finding the word boundaries in the first place. This tool splits the input on any run of non-alphanumeric characters (spaces, underscores, hyphens, dots, slashes) and also on camel humps, where a lowercase letter or digit is immediately followed by an uppercase letter. It handles consecutive capitals correctly too, so an acronym followed by a word such as HTMLParser splits into HTML and Parser rather than into five separate letters. Numbers attached to letters, such as v2 or 3d, are treated as their own tokens, which matches the behaviour most style guides and linters expect.

Which style you reach for depends on the language and on the kind of name you are writing. JavaScript, TypeScript, Java and C# favour camelCase for variables and methods and PascalCase for classes and types. Python and Rust use snake_case for variables and functions and CONSTANT_CASE for module-level constants. CSS classes, URL slugs and most CLI flags use kebab-case. Picking the convention your codebase already uses matters more than which one is theoretically "best": consistency is what keeps names readable, searchable and easy to refactor. A case style converter removes the friction of switching between conventions so you never introduce a typo while renaming by hand.

Because the whole conversion runs in your browser, this case style converter is fast and private. There is no upload, no account and no rate limit, so you can paste sensitive identifiers, internal field names or unreleased feature flags without worrying that anything leaves your machine. That makes it a safe everyday companion for the dozens of tiny renames that happen during code review, API design and database migrations, where copying a name correctly the first time saves a surprising amount of time.

The converter is also useful well beyond traditional code. Marketers building UTM parameters often need kebab-case or snake_case tags, data analysts cleaning column headers want consistent snake_case, and technical writers turning feature names into anchor links need clean URL slugs. Anywhere the same phrase has to appear in two different formats, a case style converter keeps the wording identical and only changes the shape, which is exactly what you want when two systems must agree on a name.

When to use it

  • Renaming a variable or function from one language convention to another, for example moving a snake_case Python name into a camelCase JavaScript codebase without retyping it.
  • Turning a plain English label like "Max Retry Count" into a CONSTANT_CASE constant (MAX_RETRY_COUNT) or a snake_case database column (max_retry_count).
  • Generating a kebab-case CSS class name or URL slug directly from a PascalCase component name such as UserProfileCard to user-profile-card.
  • Cleaning up an identifier that mixes separators, such as user-Profile_ID, into one consistent style across a whole file.
  • Quickly checking how the same name looks in every convention before you commit to one when designing a new API or naming a new feature flag.
  • Standardising spreadsheet or CSV column headers into snake_case before importing them into a database or a data pipeline.

How to use the Programming Case Converter

  1. Type or paste your text or identifier into the input box.
  2. The case style converter detects the individual words automatically from spaces, underscores, hyphens, dots and camelCase humps.
  3. Read off the result in every case style at once: camelCase, PascalCase, snake_case, kebab-case, CONSTANT_CASE and Title Case.
  4. Click the Copy button next to the style you need to copy it to your clipboard, then paste it straight into your code or document.

Formula & method

Step 1 (tokenize): insert a boundary between a lowercase letter or digit and a following uppercase letter (fooBar -> foo Bar), between a run of capitals and a capital plus lowercase (HTMLParser -> HTML Parser), and between letters and digits, then split on every run of non-alphanumeric characters. Step 2 (recombine): camelCase = first word lowercase + each later word Capitalised, no separator. PascalCase = every word Capitalised, no separator. snake_case = all lowercase joined by _ . kebab-case = all lowercase joined by - . CONSTANT_CASE = all UPPERCASE joined by _ . Title Case = every word Capitalised joined by spaces.
One phrase, six case stylesuser profile idcamelCaseuserProfileIdPascalCaseUserProfileIdsnake_caseuser_profile_idkebab-caseuser-profile-idCONSTANT_CASEUSER_PROFILE_IDTitle CaseUser Profile IdHow it works1. Detect word boundaries from spaces, _ , - , . and camelCase humps2. Rejoin with the right separator and capitalisation for each style

Worked examples

Convert the identifier "getUserProfile" into every case style.

  1. Tokenize: insert a boundary before each capital that follows a lowercase letter, giving "get User Profile".
  2. Words detected: [get, User, Profile].
  3. camelCase: first word lowercase, rest capitalised = getUserProfile
  4. PascalCase: every word capitalised = GetUserProfile
  5. snake_case: lowercase joined by underscore = get_user_profile
  6. kebab-case: lowercase joined by hyphen = get-user-profile
  7. CONSTANT_CASE: uppercase joined by underscore = GET_USER_PROFILE
  8. Title Case: capitalised words joined by spaces = Get User Profile

Result: getUserProfile -> GetUserProfile, get_user_profile, get-user-profile, GET_USER_PROFILE, Get User Profile

Convert the mixed string "HTML-Parser_v2" into every case style.

  1. Split on the hyphen and underscore, and split the acronym boundary, giving "HTML Parser v 2".
  2. Words detected: [HTML, Parser, v, 2].
  3. camelCase: htmlParserV2
  4. PascalCase: HtmlParserV2
  5. snake_case: html_parser_v_2
  6. kebab-case: html-parser-v-2
  7. CONSTANT_CASE: HTML_PARSER_V_2
  8. Title Case: Html Parser V 2

Result: HTML-Parser_v2 -> htmlParserV2, HtmlParserV2, html_parser_v_2, html-parser-v-2, HTML_PARSER_V_2, Html Parser V 2

Convert a plain label "Max Retry Count" into a constant and a database column.

  1. Tokenize: split on the spaces, giving the words [Max, Retry, Count].
  2. For a constant, choose CONSTANT_CASE: uppercase joined by underscore = MAX_RETRY_COUNT.
  3. For a database column, choose snake_case: lowercase joined by underscore = max_retry_count.
  4. For a JavaScript config key, choose camelCase: maxRetryCount.
  5. Copy whichever style matches the destination and paste it directly.

Result: Max Retry Count -> MAX_RETRY_COUNT (constant), max_retry_count (column), maxRetryCount (config key)

The six case styles applied to the words "user profile id"

Case styleOther namesResultTypical use
camelCaselowerCamelCase, dromedaryCaseuserProfileIdJS / Java variables and methods
PascalCaseUpperCamelCaseUserProfileIdClasses, types, components
snake_caselower_snakeuser_profile_idPython / Rust names, DB columns
kebab-casedash-case, lisp-caseuser-profile-idCSS classes, URL slugs, CLI flags
CONSTANT_CASESCREAMING_SNAKE_CASEUSER_PROFILE_IDConstants, environment variables
Title CaseStart CaseUser Profile IdHeadings, labels, UI text

Common naming conventions by language

LanguageVariables / functionsClasses / typesConstants
JavaScript / TypeScriptcamelCasePascalCaseCONSTANT_CASE
Pythonsnake_casePascalCaseCONSTANT_CASE
JavacamelCasePascalCaseCONSTANT_CASE
Rustsnake_casePascalCaseCONSTANT_CASE
GocamelCase / PascalCasePascalCasePascalCase / CONSTANT_CASE
CSSkebab-casen/an/a

Separator and capitalisation rules at a glance

Case styleSeparatorCapitalisationValid as code identifier?
camelCasenonefirst word lower, rest upperYes, in most languages
PascalCasenoneevery word upperYes, in most languages
snake_caseunderscoreall lowerYes, in most languages
kebab-casehyphenall lowerNo, hyphen reads as minus
CONSTANT_CASEunderscoreall upperYes, used for constants
Title Casespaceevery word upperNo, spaces not allowed in names

Common mistakes to avoid

  • Splitting acronyms letter by letter. A naive converter turns HTMLParser into h_t_m_l_parser. The correct boundary keeps the acronym whole (HTML, Parser), so the result is html_parser. This case style converter detects a run of capitals followed by a capital plus lowercase and breaks there.
  • Mixing conventions in one codebase. Using camelCase in some files and snake_case in others makes names harder to search and read. Pick the convention your language and project already use and apply it everywhere; the converter only helps if you stay consistent.
  • Assuming kebab-case is valid as a variable name. Hyphens are subtraction in most languages, so first-name is not a legal identifier in JavaScript, Python or Java. kebab-case is for CSS classes, URL slugs and CLI flags, not in-code variable names.
  • Losing digits or treating numbers oddly. Names like value2 or 3dModel sit on a boundary between letters and digits. This tool treats the number as its own token (value 2, 3 d model), which matches how most style guides and linters split them.
  • Confusing CONSTANT_CASE with ordinary snake_case. They share the underscore separator, so it is easy to type max_count when you meant a constant MAX_COUNT. Reserve all-uppercase CONSTANT_CASE for true constants and environment variables, and keep snake_case lowercase for regular variables and columns.
  • Starting an identifier with a digit. A token like 3dModel becomes 3dModel or 3d_model, but many languages forbid an identifier that begins with a number. Reorder the words (modelThreeD) or prefix it so the name starts with a letter before using it in code.

Glossary

camelCase
Words joined with no separator, every word capitalised except the first, for example firstName.
PascalCase
Words joined with no separator, every word including the first capitalised, for example FirstName. Also called UpperCamelCase.
snake_case
All-lowercase words joined by underscores, for example first_name.
kebab-case
All-lowercase words joined by hyphens, for example first-name. Also called dash-case or lisp-case.
CONSTANT_CASE
All-uppercase words joined by underscores, for example FIRST_NAME. Also called SCREAMING_SNAKE_CASE.
Title Case
Words kept separated by spaces with each word capitalised, for example First Name. Used for headings and labels.
Word boundary
The point where one word ends and the next begins, detected from separators or a change in letter case (a camel hump).
Identifier
A name for a variable, function, class or other entity in source code.
Slug
A URL-friendly version of a phrase, usually written in lowercase kebab-case, for example my-blog-post.

Frequently asked questions

What is a case style converter?

A case style converter is a tool that rewrites the same set of words into different naming conventions such as camelCase, PascalCase, snake_case, kebab-case, CONSTANT_CASE and Title Case. It keeps the wording identical and only changes the separators and capitalisation, so you can copy the exact format a language or system expects.

What is the difference between camelCase and PascalCase?

Both join words with no separator. camelCase leaves the first word lowercase (getUserName), while PascalCase capitalises the first word too (GetUserName). camelCase is common for variables and methods, PascalCase for classes, types and components.

How does the converter find the words in my text?

It splits on any run of non-alphanumeric characters (spaces, underscores, hyphens, dots, slashes) and on camelCase humps, where a lowercase letter or digit is followed by an uppercase letter. It also keeps acronyms whole, so HTMLParser splits into HTML and Parser.

What is kebab-case used for?

kebab-case, lowercase words joined by hyphens, is used for CSS class names, URL slugs and command-line flags. It is not valid for in-code variable names in most languages because the hyphen reads as a minus sign.

Is CONSTANT_CASE the same as snake_case?

They share the underscore separator, but snake_case is all lowercase (max_count) while CONSTANT_CASE is all uppercase (MAX_COUNT). CONSTANT_CASE, also called SCREAMING_SNAKE_CASE, is conventionally reserved for constants and environment variables.

Can I convert from snake_case back to camelCase?

Yes. The case style converter works in any direction. Paste a snake_case name like max_retry_count and it shows the camelCase form (maxRetryCount) along with every other style at the same time.

How do I turn a phrase into a URL slug?

Type the phrase, then copy the kebab-case result. For example "My First Blog Post" becomes my-first-blog-post, which is the standard lowercase, hyphen-separated format for clean, readable URL slugs.

What is the best case style for database column names?

Most SQL databases and ORMs use snake_case for column names because it is case-insensitive friendly and avoids quoting. Convert your label to snake_case (for example "First Name" to first_name) before adding the column.

Does the converter handle acronyms and numbers correctly?

Yes. It keeps acronyms whole, so HTMLParser becomes html_parser rather than h_t_m_l_parser, and it treats numbers attached to letters as their own token, so value2 splits into value and 2, matching most linters and style guides.

Does my text get sent anywhere?

No. The conversion runs entirely in your browser with plain JavaScript. Nothing you type is uploaded, stored or sent over the network, so it is safe to paste code identifiers, internal field names or unreleased feature flags.