Skip to content
Toolew.com

Variable Name Converter

Convert identifiers between camelCase, PascalCase, snake_case, kebab-case, CONSTANT_CASE and Title Case, one or many per line.

Runs in your browser. Your data is not uploaded.
Loading tool…

This guide is not yet available in your language and is shown in English.

Tool guide

What this tool does

Variable Name Converter splits each identifier into its component words, correctly handling camelCase boundaries, acronyms, digits and existing separators, then rejoins them in your chosen target case: camelCase, PascalCase, snake_case, kebab-case, CONSTANT_CASE or Title Case. Works on a single identifier or a list, one per line.

Different languages and style guides expect different naming conventions, JavaScript commonly uses camelCase, Python uses snake_case, CSS custom properties and URLs favour kebab-case, and constants are often CONSTANT_CASE, which means the same conceptual name needs re-typing by hand every time code crosses a language or convention boundary.

This converter splits an identifier into its individual words first, correctly handling camelCase boundaries (myVariable → my, Variable), consecutive capitals in acronyms (APIResponse → API, Response), digits, and any existing separators like underscores or hyphens, then rejoins those words in whichever target case you choose. It works on a single identifier or a whole list pasted one per line.

How to use Variable Name Converter

  1. Paste one identifier, or a list of identifiers one per line.
  2. Choose the Target case: camelCase, PascalCase, snake_case, kebab-case, CONSTANT_CASE, Title Case or plain lowercase words.
  3. Read the converted result, one line per input identifier.
  4. Copy the result, or swap it back into the input to try a different target case on the same list.

Tips for better results

  • An identifier with consecutive capitals, like an acronym (APIResponseCode), is split at the acronym boundary correctly (API, Response, Code), not treated as one giant word.
  • Any mix of input conventions works as input: a list containing camelCase, snake_case and kebab-case identifiers together converts correctly to a single consistent target case in one pass.
  • Digits attached to a word, like item2Count, are split out as their own segment, which keeps the resulting case conversion predictable rather than merging the digit into an adjacent word unexpectedly.
  • Use the swap button to quickly round-trip: convert to one case, then immediately try converting that same output into a different target case.

Common use cases

  • Converting a list of database column names or API field names between snake_case and camelCase for different parts of a codebase.
  • Renaming identifiers when porting code between languages with different naming conventions.
  • Generating CSS custom property names in kebab-case from camelCase JavaScript variable names, or vice versa.
  • Standardising inconsistent naming across a pasted list of variable or function names.

Common mistakes to avoid

  • Assuming the word-splitting logic treats every capital letter as a new word start; it specifically handles consecutive capitals (acronyms) as a single unit rather than splitting every individual letter.
  • Expecting non-Latin scripts or heavily symbol-laden identifiers to split as cleanly as typical alphanumeric identifiers; the splitting logic is tuned for common programming identifier conventions.
  • Forgetting that Title Case here is meant for human-readable labels (with spaces), not a valid programming identifier on its own, unlike the other target cases.

Frequently asked questions

How does it handle acronyms like API or HTML?

Consecutive capital letters are treated as a single acronym unit and split from the next word at the correct boundary, so APIResponse becomes API and Response rather than being split letter by letter.

Can I convert a whole list of identifiers at once?

Yes, paste as many identifiers as you need, one per line, and each one is converted independently to the chosen target case.

Does it matter what case the input identifiers are already in?

No, the converter first splits any input (camelCase, snake_case, kebab-case, or a mix) into its component words before rejoining them in the target case, so mixed-convention lists convert consistently.

Is Title Case a valid variable name?

No, Title Case output includes spaces and is meant for human-readable labels, not as a programming identifier; use one of the other case options for actual code.

Feedback & suggestions

Help us improve Variable Name Converter. We read every message.

Rating (optional)
Necessary
Required for security, language and theme preferences. Always on.