🔤 camelCase, snake_case, kebab-case Converter
By ToolNimba Dev Tools Team · Updated 2026-06-19
Word boundaries are detected from spaces, underscores, hyphens, dots and camelCase humps.
Type something above to see every case style.
This programming case converter rewrites any word, phrase or identifier into the naming conventions developers use every day: camelCase, PascalCase, snake_case, kebab-case, CONSTANT_CASE and Title Case. Paste a variable name like getUserProfile or a plain phrase like "user profile id" and you get all six styles at once, each with a copy button. It detects word boundaries from spaces, underscores, hyphens, dots and camel humps, so you can convert in any direction without retyping.
What is the Programming Case Converter?
A "case style" is a convention for joining several words into a single identifier when a language does not allow spaces in names. The differences are purely about the separator and which letters are capitalised. camelCase joins words with no separator and capitalises every word except the first (firstName). PascalCase, also called UpperCamelCase, capitalises every word including the first (FirstName). snake_case lowercases everything and joins with underscores (first_name). kebab-case (also dash-case or lisp-case) lowercases and joins with hyphens (first-name). CONSTANT_CASE, sometimes called SCREAMING_SNAKE_CASE, uppercases everything and joins with underscores (FIRST_NAME). Title Case keeps spaces and capitalises each word (First Name).
The hard part of converting is not changing the separator, it is finding the word boundaries in the first place. This tool splits the input on any run of non-alphanumeric characters (spaces, underscores, hyphens, dots, slashes) and also on camel humps: a lowercase letter or digit followed by an uppercase letter marks a new word. It also handles consecutive capitals correctly, so an acronym followed by a word such as HTMLParser splits into HTML and Parser rather than H, T, M, L, Parser. Numbers attached to letters (v2, 3d) are treated as their own tokens, which is the behaviour most style guides expect.
Which style you reach for depends on the language and the kind of name. JavaScript, Java and C# favour camelCase for variables and methods and PascalCase for classes and types. Python and Rust use snake_case for variables and functions and CONSTANT_CASE for constants. CSS classes, URL slugs and many command-line flags use kebab-case. Picking the convention your codebase already uses matters more than which one is "best": consistency is what makes names readable and searchable.
When to use it
- Renaming a variable or function from one language convention to another, for example moving a snake_case Python name into a camelCase JavaScript codebase.
- Turning a plain English label like "Max Retry Count" into a CONSTANT_CASE constant (MAX_RETRY_COUNT) or a snake_case database column (max_retry_count).
- Generating a kebab-case CSS class name or URL slug from a PascalCase component name.
- Cleaning up an identifier that mixes separators (such as user-Profile_ID) into one consistent style.
- Quickly checking how the same name looks across every convention before you commit to one in a new project.
How to use the Programming Case Converter
- Type or paste your text or identifier into the input box.
- The tool detects the individual words automatically from spaces, underscores, hyphens, dots and camelCase humps.
- Read off the result in every case style: camelCase, PascalCase, snake_case, kebab-case, CONSTANT_CASE and Title Case.
- Click the Copy button next to the style you need to copy it to your clipboard.
Formula & method
Worked examples
Convert the identifier "getUserProfile" into every case style.
- Tokenize: insert a boundary before each capital that follows a lowercase letter, giving "get User Profile".
- Words detected: [get, User, Profile].
- camelCase: first word lowercase, rest capitalised = getUserProfile
- PascalCase: every word capitalised = GetUserProfile
- snake_case: lowercase joined by underscore = get_user_profile
- kebab-case: lowercase joined by hyphen = get-user-profile
- CONSTANT_CASE: uppercase joined by underscore = GET_USER_PROFILE
- Title Case: capitalised words joined by spaces = Get User Profile
Result: getUserProfile -> GetUserProfile, get_user_profile, get-user-profile, GET_USER_PROFILE, Get User Profile
Convert the mixed string "HTML-Parser_v2" into every case style.
- Split on the hyphen and underscore, and split the acronym boundary, giving "HTML Parser v 2".
- Words detected: [HTML, Parser, v, 2].
- camelCase: htmlParserV2
- PascalCase: HtmlParserV2
- snake_case: html_parser_v_2
- kebab-case: html-parser-v-2
- CONSTANT_CASE: HTML_PARSER_V_2
- Title Case: Html Parser V 2
Result: HTML-Parser_v2 -> htmlParserV2, HtmlParserV2, html_parser_v_2, html-parser-v-2, HTML_PARSER_V_2, Html Parser V 2
The six case styles applied to the words "user profile id"
| Case style | Other names | Result | Typical use |
|---|---|---|---|
| camelCase | lowerCamelCase, dromedaryCase | userProfileId | JS / Java variables and methods |
| PascalCase | UpperCamelCase | UserProfileId | Classes, types, components |
| snake_case | lower_snake | user_profile_id | Python / Rust names, DB columns |
| kebab-case | dash-case, lisp-case | user-profile-id | CSS classes, URL slugs, CLI flags |
| CONSTANT_CASE | SCREAMING_SNAKE_CASE | USER_PROFILE_ID | Constants, environment variables |
| Title Case | Start Case | User Profile Id | Headings, labels, UI text |
Common naming conventions by language
| Language | Variables / functions | Classes / types | Constants |
|---|---|---|---|
| JavaScript / TypeScript | camelCase | PascalCase | CONSTANT_CASE |
| Python | snake_case | PascalCase | CONSTANT_CASE |
| Java | camelCase | PascalCase | CONSTANT_CASE |
| Rust | snake_case | PascalCase | CONSTANT_CASE |
| Go | camelCase / PascalCase | PascalCase | PascalCase / CONSTANT_CASE |
| CSS | kebab-case | n/a | n/a |
Common mistakes to avoid
- Splitting acronyms letter by letter. A naive converter turns HTMLParser into h_t_m_l_parser. The correct boundary keeps the acronym whole (HTML, Parser), so the result is html_parser. This tool detects a run of capitals followed by a capital plus lowercase and breaks there.
- Mixing conventions in one codebase. Using camelCase in some files and snake_case in others makes names harder to search and read. Pick the convention your language and project already use and apply it everywhere, the converter only helps if you stay consistent.
- Assuming kebab-case is valid as a variable name. Hyphens are subtraction in most languages, so first-name is not a legal identifier in JavaScript, Python or Java. kebab-case is for CSS classes, URL slugs and CLI flags, not in-code variable names.
- Losing digits or treating numbers oddly. Names like value2 or 3dModel sit on a boundary between letters and digits. This tool treats the number as its own token (value 2, 3 d model), which matches how most style guides and linters split them.
Glossary
- camelCase
- Words joined with no separator, every word capitalised except the first, for example firstName.
- PascalCase
- Words joined with no separator, every word including the first capitalised, for example FirstName. Also called UpperCamelCase.
- snake_case
- All-lowercase words joined by underscores, for example first_name.
- kebab-case
- All-lowercase words joined by hyphens, for example first-name. Also called dash-case.
- CONSTANT_CASE
- All-uppercase words joined by underscores, for example FIRST_NAME. Also called SCREAMING_SNAKE_CASE.
- Word boundary
- The point where one word ends and the next begins, detected from separators or a change in letter case (a camel hump).
- Identifier
- A name for a variable, function, class or other entity in source code.
Frequently asked questions
What is the difference between camelCase and PascalCase?
Both join words with no separator. camelCase leaves the first word lowercase (getUserName), while PascalCase capitalises the first word too (GetUserName). camelCase is common for variables and methods, PascalCase for classes and types.
How does the converter find the words in my text?
It splits on any run of non-alphanumeric characters (spaces, underscores, hyphens, dots, slashes) and on camelCase humps, where a lowercase letter or digit is followed by an uppercase letter. It also keeps acronyms whole, so HTMLParser splits into HTML and Parser.
What is kebab-case used for?
kebab-case (lowercase words joined by hyphens) is used for CSS class names, URL slugs and command-line flags. It is not valid for in-code variable names in most languages because the hyphen reads as a minus sign.
Is CONSTANT_CASE the same as snake_case?
They share the underscore separator, but snake_case is all lowercase (max_count) while CONSTANT_CASE is all uppercase (MAX_COUNT). CONSTANT_CASE is conventionally reserved for constants and environment variables.
Can I convert from snake_case back to camelCase?
Yes. The tool works in any direction. Paste a snake_case name like max_retry_count and it shows the camelCase form (maxRetryCount) along with every other style at the same time.
Does my text get sent anywhere?
No. The conversion runs entirely in your browser with plain JavaScript. Nothing you type is uploaded, stored or sent over the network, so it is safe to paste code identifiers.