{ }
中文

Case Converter

Convert text between camelCase, PascalCase, snake_case, kebab-case, CONSTANT_CASE, Title Case, and Sentence case.

camelCasehelloWorldFromDevToolBox
PascalCaseHelloWorldFromDevToolBox
snake_casehello_world_from_dev_tool_box
kebab-casehello-world-from-dev-tool-box
CONSTANT_CASEHELLO_WORLD_FROM_DEV_TOOL_BOX
Title CaseHello World From Dev Tool Box
Sentence caseHello world from dev tool box
lowercasehello world from devtoolbox
UPPERCASEHELLO WORLD FROM DEVTOOLBOX

Case conventions in code

Naming conventions vary across languages and ecosystems. JavaScript and Java use camelCase for variables and functions, PascalCase for classes and React components. Python and Rust prefer snake_case for variables and functions and PascalCase for types. Cascading style sheets, HTML attributes, and URL slugs use kebab-case. Environment variables and constants are conventionally CONSTANT_CASE in nearly every ecosystem.

Switching between conventions by hand is error-prone — especially when the source has acronyms or numbers. This tool tokenises your input into individual words by detecting word boundaries (whitespace, separators, and capital-letter transitions) and then reassembles the words in the target style. Acronyms are preserved in PascalCase output and lowercased in camelCase output, matching the behaviour of popular libraries such as lodash and change-case.

Use cases

  • Rename a TypeScript identifier from snake_case (returned by a Python API) to camelCase before assignment.
  • Generate a kebab-case URL slug from a human-readable title.
  • Convert a column list from a SQL CREATE TABLE statement into TypeScript interface keys.
  • Translate a CONSTANT_CASE feature flag name into a sentence-cased label.
  • Bulk rename test fixtures so they conform to your project's style.

Best practices

  • Pick a convention per layer (database, API, UI) and stick to it; convert at the boundary.
  • Keep acronyms uppercase in PascalCase (e.g. JSONParser) only if the surrounding code does so consistently.
  • Avoid mixing styles in a single file — readers infer meaning from convention.
  • When generating slugs, also strip diacritics and limit length to 60 characters for SEO friendliness.

Frequently asked questions

How are word boundaries detected?
By splitting on whitespace, hyphens, underscores, dots, and the transition between a lowercase letter and an uppercase letter.
What happens to acronyms?
Acronym handling depends on the target style. PascalCase preserves them; camelCase lowercases the first acronym only when it appears at the start of the identifier.
Are numbers treated as their own word?
Numbers stay attached to the preceding word. Customise the separator if your style guide requires otherwise.
Does it support non-ASCII letters?
Yes — Unicode letters are recognised, but case mapping for some scripts (Turkish dotted/dotless I) may differ from the default JavaScript locale.