How to convert text case
- Type or paste text, a variable name or a list of names (one per line).
- Every case is generated at once. Copy the one you need.
Naming conventions by language
- JavaScript / TypeScript:
camelCasevariables,PascalCaseclasses and components. - Python:
snake_casefunctions and variables,PascalCaseclasses. - Go:
camelCase, orPascalCaseto export. - CSS and URLs:
kebab-case. - Environment variables:
CONSTANT_CASE.
Frequently asked questions
When should I use camelCase, snake_case or kebab-case?
It depends on the language. JavaScript and Java use camelCase for variables and PascalCase for classes. Python and Ruby use snake_case. CSS classes, URLs and file names usually use kebab-case. Constants and environment variables use CONSTANT_CASE.
How are words detected?
Words are split on spaces, punctuation, underscores, hyphens and changes from lowercase to uppercase. Acronyms are kept together, so XMLHttpRequest becomes xml_http_request.
Can I convert many names at once?
Yes. Each line is converted separately, so you can paste a list of column names or variables and convert them all in one go.
What is a URL slug?
A slug is the readable part of a URL, such as my-first-post. It contains only lowercase letters, numbers and hyphens, with accents removed so it works everywhere.