Skip to content
WebTricks

Case converter

Convert text to camelCase, snake_case, kebab-case, PascalCase, CONSTANT_CASE, Title Case and URL slugs at once.

camelCasehelloWorld,ThisIsWebTricks
PascalCaseHelloWorld,ThisIsWebTricks
snake_casehello_world,_this_is_web_tricks
kebab-casehello-world,-this-is-web-tricks
CONSTANT_CASEHELLO_WORLD,_THIS_IS_WEB_TRICKS
Title CaseHello World, This Is Web Tricks
Sentence caseHello world, this is web tricks
slughello-world-this-is-web-tricks

What this case converter does

Paste any identifier, heading or phrase and get it back in eight naming styles simultaneously: camelCase, PascalCase, snake_case, kebab-case, CONSTANT_CASE, Title Case, Sentence case and a URL-safe slug, each with its own copy button. The converter first breaks the input into lowercase words, using spaces, underscores, hyphens, dots, slashes and camelCase humps as boundaries, then re-joins those words per style. That means the input can already be in any case; userProfileURL, user_profile_url and User profile URL all produce the same set of outputs.

How to use it

  1. Type or paste into the Text field. All eight outputs update as you type.
  2. Click the copy button next to the style you need.
  3. To go from one style to another, just paste the source identifier; you do not have to pick an input format.

Case styles and where each is conventional

StyleExampleTypical use
camelCaseuserProfileUrlJavaScript and TypeScript variables, functions, object keys; Java and Kotlin methods; JSON APIs from JS backends
PascalCaseUserProfileUrlClass, type, interface and enum names in almost every language; React components; C# public members
snake_caseuser_profile_urlPython variables and functions, Ruby, Rust, SQL columns and tables, PostgreSQL identifiers, Go JSON tags
kebab-caseuser-profile-urlCSS classes and custom properties, HTML attributes and ids, URLs, npm package names, CLI flags, Kubernetes resource names
CONSTANT_CASEUSER_PROFILE_URLEnvironment variables, constants in C, Java, Python and JS, Makefile variables, feature flags
Title CaseUser Profile UrlHeadings, labels, button text, menu items
Sentence caseUser profile urlBody copy, error messages, tooltips, form hints
sluguser-profile-urlURL paths and filenames where only a-z, 0-9 and - are safe

A few style guides to note: Google’s JavaScript guide and Airbnb’s both say camelCase for variables and PascalCase for classes; PEP 8 mandates snake_case for Python functions and UPPER_SNAKE for constants; the CSS Working Group uses kebab-case for every property and value; and Kubernetes rejects anything but lowercase alphanumerics and hyphens in resource names.

Worked examples

InputcamelCasesnake_casekebab-caseslug
Hello world, this is WebTrickshelloWorld,ThisIsWebtrickshello_world,_this_is_webtrickshello-world,-this-is-webtrickshello-world-this-is-webtricks
parseHTMLResponseparseHtmlResponseparse_html_responseparse-html-responseparse-html-response
src/components/nav-bar.tsxsrcComponentsNavBarTsxsrc_components_nav_bar_tsxsrc-components-nav-bar-tsxsrc-components-nav-bar-tsx
10 Tips & Tricks10Tips&Tricks10_tips_&_tricks10-tips-&-tricks10-tips-tricks

Notice the first and last rows: the seven case styles keep punctuation that is not a separator (commas, ampersands), because they are meant to transform words, not sanitize them. Only the slug strips those characters. If you are generating a filename or URL, copy the slug; if you are renaming a variable, your input probably has no punctuation to begin with.

Acronyms and the Title Case caveat

Acronyms lose their capitals in every output except CONSTANT_CASE: XMLHttpRequest becomes xmlHttpRequest, xml_http_request, Xml Http Request. That matches the convention most modern style guides recommend (HttpClient, not HTTPClient) and is what TypeScript’s own codebase does. Title Case here is also mechanical: it capitalizes every word, including “a”, “of” and “the”. Editorial title case (AP or Chicago style) keeps short articles and prepositions lowercase, so adjust by hand for headlines.

  • Regex tester to find every identifier in a file that still uses the old convention.
  • URL encoder when a slug still needs percent-encoding, for example because it contains a query string.
  • Text diff to review a bulk rename before committing it.
  • Lorem ipsum generator for placeholder headings to test Title Case layouts.

FAQ

What is the difference between snake_case and kebab-case?

Both lowercase every word. snake_case joins them with underscores (user_id) and is standard in Python, Ruby, SQL and most databases. kebab-case joins them with hyphens (user-id) and is used in URLs, CSS class names, HTML attributes and npm package names.

How is the slug different from kebab-case?

Slug is kebab-case with every non-alphanumeric character removed, so it stays safe to use in a URL path. Hello, world! becomes hello-world in both, but 'v2.0 (beta)' becomes v2-0-beta as a slug while kebab-case would keep the parentheses.

Does it handle existing camelCase or PascalCase input?

Yes. The converter splits on lowercase-to-uppercase boundaries, so parseHTMLResponse becomes the words parse, html, response and can be re-joined in any style. Runs of capitals such as HTML or API are kept together as one word.

Which characters count as word separators?

Spaces, tabs, newlines, underscores, hyphens, dots and forward slashes. So a file path like src/components/nav-bar.tsx is split into src, components, nav, bar, tsx.

Does it work with accented or non-Latin letters?

The seven case styles keep any letters you type and only change ASCII casing. The slug output strips everything outside a-z and 0-9, so accented characters are dropped rather than transliterated. Replace é with e yourself if you need it preserved.

Can I convert many lines at once?

The input is a single-line field, so newlines are treated as separators and the whole input is joined into one identifier. Convert one identifier at a time, or paste a multi-word phrase.