Text Case Converter — camelCase, snake_case, kebab-case & More

IP & Network 閲覧

Why Naming Conventions Matter

Different languages and frameworks have different conventions for variable names, function names, and file names. Following the right convention makes code readable and is a fundamental part of team collaboration. When switching projects, connecting APIs, or generating code, you frequently need to convert between naming formats quickly.

Common Naming Conventions Explained

FormatExampleCommon in
camelCasemyVariableNameJavaScript variables/functions, Java methods, JSON keys
PascalCaseMyVariableNameClass names (all languages), React components, C# methods
snake_casemy_variable_namePython, Ruby, database column names, Rust
UPPER_SNAKE_CASEMY_VARIABLE_NAMEConstants (Python, Java, C), environment variables
kebab-casemy-variable-nameHTML/CSS attributes, URL slugs, file names, Vue props
Title CaseMy Variable NameHeadings, page titles, UI labels

How to Convert Text Case Online

Use tool.tl's text case converter:

  1. Go to tool.tl/text-case
  2. Paste your text in any format
  3. Click the target format button (camelCase, snake_case, PascalCase, etc.)
  4. The converted result appears instantly — click to copy

How the Conversion Works

Most converters follow these steps:

  1. Tokenize: Split the input into words (recognizing spaces, hyphens, underscores, and uppercase boundaries)
  2. Normalize: Convert all tokens to lowercase
  3. Reassemble: Join with the target format's separator or capitalization rules
// JavaScript: snake_case → camelCase
const toCamel = s => s.replace(/_([a-z])/g, (_, c) => c.toUpperCase());
toCamel('my_variable_name');  // → 'myVariableName'

// JavaScript: camelCase → kebab-case
const toKebab = s => s.replace(/([A-Z])/g, '-$1').toLowerCase();
toKebab('myVariableName');  // → 'my-variable-name'

Real-World Use Cases

  • API integration: Backend Python returns snake_case; frontend JavaScript needs camelCase — batch rename response properties
  • Database to code: DB column names are typically snake_case; ORM model properties may be camelCase or PascalCase
  • File naming: Convert component names from PascalCase to kebab-case filenames (MyComponentmy-component.vue)
  • URL slugs: Convert article titles to kebab-case slugs for SEO-friendly URLs

Frequently Asked Questions

kebab-case or snake_case for URLs?

Use kebab-case for URLs. Google recommends hyphens over underscores as word separators in URLs — underscores are not treated as word boundaries by Google's crawler. Hyphens are also more readable in link text where underscores can be hidden by underline styling.

Is there a universal Title Case standard?

No universal standard. The most common rule capitalizes all words, with some styles keeping short prepositions (a/an/the/in/on/at/of) lowercase. Different style guides (APA, Chicago, AP) have slightly different rules. Most tools use the simple approach: capitalize every word's first letter.

Is the tool free?

Yes — tool.tl's text case converter is completely free, instant, and requires no account.