When to use each case
camelCase is common for JavaScript and Java variables and function names. snake_case is often used in databases, Python, and Ruby. PascalCase is typical for class, type, and component names. kebab-case works well in URLs, file names, and CSS class names. Keeping to the convention of your language or framework makes code easier to read and review.
How to use this tool
- Type or paste a phrase into the Text to convert box.
- Select the format you need: camelCase, snake_case, PascalCase, or kebab-case.
- Read the result and select Copy result to copy it.
Examples
Starting from customer order status:
- camelCase:
customerOrderStatus - snake_case:
customer_order_status - PascalCase:
CustomerOrderStatus - kebab-case:
customer-order-status
Names that are already in a code convention can be converted too. userAccountId is split into user, account, and id, so it can become user_account_id or user-account-id. This is handy when you move a field name between a JavaScript front end and a database column.
How it works
The tool splits your input into words and joins them again in the format you choose. Words are separated by spaces, punctuation, underscores, or hyphens, and also at the point where a lowercase letter is followed by an uppercase letter. All words are lowercased first, then capitalized as the target format requires. The conversion runs locally in your browser and does not send the text to TxConv.
Limitations
- Only the letters
A-Z,a-z, and the digits0-9are kept. Other characters, including accented letters and Japanese text, act as separators and are dropped. - A run of consecutive capital letters is treated as one word, so
XMLHttpRequestbecomesxmlhttpRequestin camelCase rather thanxmlHttpRequest. - Line breaks are also separators. The whole input becomes a single identifier, so convert one name at a time.
- Title Case and SCREAMING_SNAKE_CASE are not available in this English edition. The Japanese edition of the case converter also supports SCREAMING_SNAKE_CASE.
Frequently asked questions
Which case should I use for URLs?
Lowercase kebab-case is the usual choice for URLs and file names, because hyphens are easy to read and are treated as word separators by search engines.
What happens to numbers?
Digits are kept as part of the words. version 2 api becomes version2Api in camelCase and version_2_api in snake_case.
Can I convert several names at once?
Not in a single step. Because line breaks are treated as separators, a multi-line input is merged into one identifier. Convert each name separately.
Is my text uploaded anywhere?
No. The conversion runs in your browser and the text you type is not sent to TxConv.
More English tools
- Base64 Encoder & Decoder – Encode and decode UTF-8 text.
- JSON Formatter & Validator – Format, validate, and minify JSON.
Looking for Japanese text tools such as full-width/half-width conversion, hiragana/katakana conversion, or tax calculation? See the Japanese edition of TxConv.