"category": "dev-utility",
Case Converter
"tldr": Paste identifiers (one per line) and get every casing at once: camelCase, PascalCase, snake_case, kebab-case, CONSTANT_CASE, and more.
Paste one or more identifiers - any casing, one per line - and get all seven standard conventions for each: camelCase, PascalCase, snake_case, kebab-case, CONSTANT_CASE, Title Case, and dot.case. Mixed input like APIResponseData or user_name is split into words intelligently, including consecutive-capital acronyms.
Renaming across convention boundaries is constant work at API seams: a snake_case JSON payload meets camelCase TypeScript, a kebab-case CSS class meets PascalCase components, an env var needs CONSTANT_CASE. Batch mode means a whole field list converts in one paste.
How to convert identifier cases
- 1Paste identifiers, one per line - any input convention works.
- 2Words are detected from underscores, hyphens, dots, and capital-letter boundaries.
- 3All seven conventions are listed for each identifier.
- 4Copy the one you need - or the whole block for a mapping table.
Convert Identifiers to All cases in code
import { camelCase, kebabCase, snakeCase } from "change-case";
camelCase("user_name"); // 'userName'
snakeCase("userName"); // 'user_name'import re
def snake(s):
s = re.sub(r"([a-z0-9])([A-Z])", r"\1_\2", s)
return re.sub(r"[^a-zA-Z0-9]+", "_", s).lower()Frequently asked questions
How are acronyms like API or ID handled?
Consecutive capitals are treated as one word until the last capital before a lowercase letter: APIResponseData splits into api + response + data. This matches how most style guides want acronyms folded (ApiResponseData in strict PascalCase) - note some codebases prefer preserving APIS caps, which is a style choice no converter can guess.
Which case should I use where?
The strong conventions: camelCase for JS/Java variables, PascalCase for types and React components, snake_case for Python and most JSON APIs and SQL, kebab-case for URLs, CSS classes, and CLI flags, CONSTANT_CASE for env vars and constants. Consistency within a layer beats any individual choice.
Can I convert JSON keys between cases automatically?
For whole documents, do it at the serialization boundary instead of renaming by hand: Jackson naming strategies (Java), serde rename_all (Rust), or a mapWith(camelCase) transform in JS. Our JSON code generators emit exactly those mappings for you.
Last updated:
You might also need
Free and in-browser, like everything on JSON Console. Browse all tools →