Switch tool

Naming Converter

Convert between camelCase, PascalCase, snake_case, kebab-case, CONSTANT_CASE.

Identifier
0 chars · 1 lines
camelCase
PascalCase
snake_case
kebab-case
CONSTANT_CASE
dot.case

How to use

Purpose

Online naming-style converter supporting camelCase, PascalCase, snake_case, SCREAMING_SNAKE_CASE, kebab-case, Train-Case, dot.case, space case. Common for cross-language migration (Java camelCase ↔ Python snake_case ↔ Rust snake_case), database column names to code variables, URL path to variable name, CSS class to JS variable. All conversion runs locally.

Steps

  1. Type any-style identifier on the left (auto-detected)
  2. Right pane shows all 7 style conversions simultaneously
  3. Batch: one identifier per line, bulk convert to target style
  4. Preserve special chars: digits, Unicode preserved
  5. Acronym handling: HTTPClient → http_client (default whole-acronym) or HTTP_Client (per-letter)
  6. First-letter rule: PascalCase ↔ camelCase differs only in first-letter case
  7. Options: ignore repeated separators in source, preserve leading/trailing space, handle empty strings
  8. One-click copy target style or all 7 styles

FAQ

JavaScript/Java use camelCase; why does Python use snake_case?
Historical convention. JavaScript/Java/Kotlin/Swift/C# use camelCase (variables/methods) + PascalCase (classes). Python/Ruby/Rust/C use snake_case. Go uses camelCase, but exported symbols are PascalCase (uppercase first letter = public). Constants are universally SCREAMING_SNAKE_CASE.
Where is kebab-case used?
URL paths, CSS class names, HTML attributes, file names: my-component, on-click, data-attribute, package-name.json. Programming variables cannot use kebab-case (hyphen is interpreted as minus). Lisp / Clojure are exceptions — their variables can include hyphens.
"XML HTTP Request" → camelCase: XMLHttpRequest or XmlHttpRequest?
Google JS/Java style: XmlHttpRequest (acronym as word, first letter caps). Microsoft style: XMLHttpRequest (acronym all caps). The actual Web API is XMLHttpRequest (legacy). New code recommends Google style: consecutive caps are hard to read.
How does user_name (DB) become a Java entity property?
Java convention: camelCase: `private String userName;`. Spring Data JPA / MyBatis automap user_name ↔ userName by convention. If the column name is unusual, mark explicitly with `@Column(name="user_name")`.
How are acronyms like "i18n" or "k8s" handled?
Acronyms with digits are treated as single tokens. snake_case: i_18_n (split by digit) or i18n (preserve). kebab-case: i-18-n or i18n. Production code prefers preserving (i18n, k8s) — industry convention. The tool defaults to preserve; toggle "split by digit" if needed.

Use cases

  • Cross-language migration: rename variables when migrating Java project to Python
  • DB column to code variable: user_name → userName (Java/JS) or keep user_name (Python)
  • URL path generation: page-title → PageTitle for route component name
  • CSS class to JS variable: auto camelCase for CSS modules
  • Constant definition: convert plain text to SCREAMING_SNAKE_CASE

Use cases

Cross-language migration, DB column-to-variable, URL-to-component name, CSS-class-to-JS-variable, constant naming. Daily developer task. All-7-styles simultaneous, acronym handling, batch are the differentiators.