How to Convert Between camelCase, snake_case and More
To convert an identifier between camelCase, snake_case, kebab-case and other styles, paste it into a code case converter and it shows every case form at once so you copy the one you need. You do not pick a target format first; the tool splits your input into words and renders all seven common styles simultaneously.
This guide walks through using the converter, explains how the word-splitting works, and shows why it runs entirely in your browser.
Step-by-step
- Paste your identifier into the input box in whatever case it is currently written —
userID,user_id,User Id, it does not matter. - Let it split automatically. The tool detects word boundaries the instant you type, so there is no convert button to wait on.
- Read every case form — camelCase, PascalCase, snake_case, kebab-case, CONSTANT_CASE, dot.case and Title Case — laid out together.
- Click Copy next to the form you want and paste it into your code.
Because output updates live, you can tweak the input and instantly see how each style changes.
How the word splitting works
The quality of any case conversion comes down to how well it detects words. The Code Case Converter breaks your input on spaces, underscores, hyphens and dots, and also on camelCase humps — the point where a lowercase letter meets an uppercase one. It handles runs of capitals sensibly too, so an acronym stays intact:
| Input | Detected words | snake_case output |
|---|---|---|
| userID | user, ID | user_id |
| XMLHttpRequest | XML, Http, Request | xml_http_request |
| first-name-field | first, name, field | first_name_field |
| MAX_RETRY_COUNT | MAX, RETRY, COUNT | max_retry_count |
The seven styles at a glance
- camelCase —
myVariableName, common for variables and functions. - PascalCase —
MyVariableName, typical for classes and components. - snake_case —
my_variable_name, common in Python and databases. - kebab-case —
my-variable-name, common in URLs and CSS. - CONSTANT_CASE —
MY_VARIABLE_NAME, used for constants and env vars. - dot.case —
my.variable.name, used in some config keys. - Title Case —
My Variable Name, for headings and labels.
Why it runs in your browser
Every conversion happens locally in JavaScript. Nothing you type is uploaded, logged or stored, so it is safe for internal field names, unreleased schemas and proprietary code. It also works offline once loaded, which is handy on a locked-down machine or a flaky connection.
Try the Code Case Converter — free and 100% in your browser.
FAQ
Do I have to choose a source format?
No. The converter detects word boundaries from any mix of separators and camelCase humps, so you paste the identifier as-is and it figures out the words for you.
Can I convert a phrase with spaces?
Yes. Spaces are treated as word separators, so Order Line Item splits into three words and renders correctly as orderLineItem, order_line_item and every other style.
What happens to numbers in my identifier?
Digits stay attached to their surrounding word, so an input like address2 keeps the 2 with address rather than treating it as a separate token.
Is there a limit on length?
There is no practical limit for typical identifiers. Since it all runs locally, you can convert long, multi-word names without any round trip to a server.
Related free tools
- Case Converter — change the case of ordinary sentences and text.
- Slug Generator — turn a title into a clean URL slug.
- JSON Formatter — tidy and validate JSON.
- NanoID Generator — create short unique IDs.
Built by ByteVancer
ByteTools is a free product of ByteVancer, a software and web development studio building web apps, SaaS and custom software. If your team wrestles with naming conventions across a large codebase, explore how ByteVancer can help design and build cleaner systems.
Recommended reading
Code Case Conversion: Best Practices and Pitfalls
Pick the right case style and avoid acronym and word-splitting mistakes with these best practices for converting code identifiers.
Code Case Converter Use Cases: Real Dev Workflows
Real scenarios where a code case converter saves time, from renaming variables to mapping API fields to database columns, with examples.
Case Converter Use Cases: 7 Real Jobs It Solves Fast
See where a case converter earns its keep: renaming variables, fixing caps-lock headlines, cleaning spreadsheets and formatting URLs, with worked examples.
Case Converter Guide: Fix Capitalization in One Click
Convert text between UPPERCASE, lowercase, Title Case, camelCase, snake_case and more online, with a clear guide to which case style to use when.