Case Converter

Convert text to camelCase, snake_case, PascalCase, kebab-case and 10+ other styles

What Is a Case Converter?

A case converter is a small utility that rewrites text into a different naming style. Programmers use it constantly: switching a variable from camelCase to snake_case when porting code from JavaScript to Python, generating CONSTANT_CASE environment variable names from a feature description, or producing a kebab-case CSS class from a component name. Writers and editors reach for it too — to fix a heading that arrived in ALL CAPS, or to turn a raw phrase into Title Case. This tool covers every common style, from code conventions like camelCase and snake_case to writing styles like Title Case, UPPERCASE and lowercase, in one panel — paste your text, and you get every variant at once.

Common Case Styles

StyleExampleWhere it’s used
camelCasehelloWorldExampleVariables and functions in JavaScript, Java, Kotlin, Swift
PascalCaseHelloWorldExampleClasses, types, components (React, C#, TypeScript)
snake_casehello_world_exampleVariables and functions in Python, Ruby, Rust
CONSTANT_CASEHELLO_WORLD_EXAMPLEConstants and environment variables everywhere
kebab-casehello-world-exampleURLs, CSS classes, HTML attributes, CLI flags
COBOL-CASEHELLO-WORLD-EXAMPLEHTTP headers (in some style guides), legacy COBOL
Train-CaseHello-World-ExampleSome HTTP headers (Content-Type), book titles
Title CaseHello World ExampleArticle titles, UI labels
Sentence caseHello world exampleBody copy, button labels (modern UI guidelines)
UPPERCASEHELLO WORLD EXAMPLEHeadings, emphasis, spreadsheet labels, legal text
lowercasehello world exampleTags, search normalization, de-shouting all-caps text
dot.casehello.world.exampleJava package names, config keys
path/casehello/world/exampleURL paths, file system paths

How to Convert Cases

  1. Paste any text into the input area — a single identifier, a sentence, or many lines at once.
  2. Press Ctrl+Enter or click the Convert button. The output panel shows every case variant.
  3. Copy the line you need. The whole table copies with one click via the Copy button or Ctrl+Shift+C.
  4. Type to convert in real time — the tool re-converts on every keystroke (debounced) so you can iterate quickly.

The conversion is fully bidirectional. You can paste helloWorldExample, hello_world_example, hello-world-example or Hello World Example — the tool detects the original style by scanning for word boundaries and re-emits the value in every other style.

How Word Boundaries Are Detected

A robust case converter has to recognize where words begin and end no matter how the input is formatted. This tool uses three rules:

  • Separator characters — underscores (_), hyphens (-), spaces, dots (.), and slashes (/) split the input into words.
  • Case transitions — a lowercase letter followed by an uppercase letter starts a new word (helloWorldhello, World).
  • Acronym handling — a sequence of uppercase letters followed by a lowercase letter splits before the last uppercase (XMLHttpRequestXML, Http, Request). This matters when you convert acronym-heavy code.

Numbers stay attached to the surrounding word (getHTML5PlayergetHtml5Player or get_html5_player), which is what most style guides prescribe.

camelCase vs snake_case

This is the most-Googled case-conversion question. The answer is mostly cultural, not technical:

  • JavaScript, TypeScript, Java, Kotlin, Swift, C# — community style guides and language conventions favor camelCase for variables and methods. The standard library is camelCase. Frameworks like React lean on PascalCase for components and camelCase for props.
  • Python and Ruby — PEP 8 (Python) and the Ruby community guide both prescribe snake_case for variables, functions and module names. PascalCase is reserved for classes; CONSTANT_CASE for constants.
  • Rust and Go — Rust uses snake_case for items and PascalCase for types. Go uses MixedCaps (essentially PascalCase for exported, camelCase for unexported) and lints any deviation.
  • C and C++ — historically snake_case in the standard library and many older codebases; many modern style guides allow either.
  • SQL — most teams use snake_case for table and column names because identifiers are case-insensitive in many engines and quoting mixed-case is awkward.

When in doubt: read the existing code in the repo and match its style. Consistency inside one project beats any abstract preference for one style over another.

Convert snake_case to camelCase (and Back)

The two most-requested conversions are snake_casecamelCase and camelCasesnake_case, usually when moving data across a boundary — a Python or SQL backend that speaks snake_case talking to a JavaScript or TypeScript frontend that speaks camelCase. Both directions work the same way here:

  1. Paste the identifier — user_first_name or userFirstName — into the input.
  2. Read the matching line from the output: the camelCase row gives userFirstName, the snake_case row gives user_first_name.
  3. Copy that single line, or click Copy All to grab the whole set.

Because the converter normalizes the input to a list of words before re-emitting it, the starting style never matters: user_first_name, userFirstName, UserFirstName and user-first-name all produce the exact same set of outputs. That means you can round-trip an identifier through any style and back without losing information — handy when you’re not sure which convention a snippet came from.

Text Case for Writing: Title Case, UPPERCASE and lowercase

Case conversion isn’t only for code. Writers, editors and marketers reshape prose case constantly, and this tool handles those styles too:

  • Title Case — capitalizes the first letter of each word (Hello World Example). Used for headlines, article titles, button labels and UI headings. Strict style guides such as AP and Chicago lowercase short articles and prepositions like a, the, of and to; this tool applies the simpler “capitalize every word” rule, which is what most CMS and UI contexts actually expect.
  • Sentence case — capitalizes only the first word (Hello world example). Modern UI guidelines (Google Material, Apple’s Human Interface Guidelines) increasingly prefer sentence case for buttons and headings because it reads as less shouty and more conversational.
  • UPPERCASE — every letter capitalized (HELLO WORLD EXAMPLE). Useful for headings, emphasis, spreadsheet column labels and systems that store values in caps.
  • lowercase — every letter lowercased (hello world example). Useful for tags, URL slugs, search normalization and de-shouting text that arrived in all caps.

Paste a heading that came in the wrong case and you get every writing style at once — no retyping required. Like everything else here, it runs entirely in your browser, so you can safely convert unpublished copy or internal document titles.

Common Mistakes When Converting Case

  • Losing acronym capitalization — naive conversion turns parseHTML into parsehtml instead of parse_html. Use a converter that recognizes acronym runs.
  • Concatenating numbers into separate wordsmp3Player should become mp3_player, not mp_3_player. Most style guides keep digits glued to the preceding word.
  • Mangling Unicode letters — accented characters like é and ñ should keep their case-folding behavior. This tool uses JavaScript’s toLowerCase() and toUpperCase(), which respect Unicode rules.
  • Trimming meaningful separators — converting a file path like src/components/Button.tsx should preserve the path structure, not flatten it. If you’re working with paths, use the dedicated path/case output.

When to Use This Tool

  • Porting code between languages — translate a Python API to TypeScript, or the other way around, and rename every identifier.
  • Generating environment variable names — turn a feature description like “stripe webhook secret” into STRIPE_WEBHOOK_SECRET.
  • Building CSS class names from component namesUserProfileCarduser-profile-card.
  • Cleaning up a CSV header rowFirst Name, Last Name, Email Addressfirst_name, last_name, email_address for SQL ingestion.
  • Renaming a batch of identifiers — paste an entire list, get the converted output, paste it back.

Everything runs locally in your browser. No data leaves your machine, which means you can safely paste internal identifiers, API endpoints or proprietary feature names without worrying about a third-party server logging them.

Frequently Asked Questions

What is camelCase?

camelCase is a naming convention where the first word starts with a lowercase letter and each subsequent word starts with an uppercase letter, with no spaces or separators. Example: helloWorldExample. It's the default style for variables and functions in JavaScript, Java, and Swift.

What is the difference between camelCase and PascalCase?

camelCase starts with a lowercase letter (helloWorld), while PascalCase starts with an uppercase letter (HelloWorld). PascalCase is also called UpperCamelCase. The rule of thumb in most languages is: PascalCase for classes and types, camelCase for variables and functions.

How do I convert camelCase to snake_case?

Paste your camelCase text into the input field. The tool detects word boundaries automatically by looking at lowercase-to-uppercase transitions and outputs all case variants instantly, including snake_case. For example, helloWorldExample becomes hello_world_example.

Which case style should I use in my code?

Follow the convention of the language and project you're working in. Python and Ruby prefer snake_case for variables and functions. JavaScript, Java, Kotlin and Swift prefer camelCase. CSS classes and HTML attributes use kebab-case. Constants in most languages use SCREAMING_SNAKE_CASE.

Can I convert multiple lines at once?

Yes. Paste any block of text and each non-empty line is converted independently. This is useful when you have a list of variable names that need to be reformatted in bulk — for example, when porting an API spec from one language to another.

Is my text sent to a server?

No. All conversion happens entirely in your browser using JavaScript. Your text never leaves your machine, which makes the tool safe to use with proprietary code, internal API names or sensitive identifiers.

What does CONSTANT_CASE mean?

CONSTANT_CASE — also called SCREAMING_SNAKE_CASE — is a style where all letters are uppercase and words are separated by underscores. It's used for constants and environment variables in most languages: MAX_RETRY_COUNT, DATABASE_URL, API_KEY.

How do I convert text to UPPERCASE or lowercase?

Paste your text and read the UPPERCASE line (every letter capitalized, HELLO WORLD) or the lowercase line (every letter lowercased, hello world) from the output. Both are produced instantly alongside every other style, so you can fix a heading that arrived in ALL CAPS or normalize shouty text in one step.

How do I convert snake_case to camelCase?

Paste the snake_case identifier — for example user_first_name — and copy the camelCase line from the output, which gives userFirstName. The conversion is bidirectional: paste camelCase and the snake_case line gives you user_first_name back. This is the most common conversion when moving data between a Python or SQL backend and a JavaScript frontend.

What is the difference between Title Case and Sentence case?

Title Case capitalizes the first letter of every word (Hello World Example) and is used for headlines and UI headings. Sentence case capitalizes only the first word (Hello world example) and is increasingly preferred for buttons and labels in modern design systems like Google Material and Apple's Human Interface Guidelines.

What is kebab-case used for?

kebab-case joins lowercase words with hyphens (hello-world-example). It's the standard for URL slugs, CSS class names, HTML data attributes, npm package names and command-line flags. It's called kebab-case because the hyphens look like items skewered on a kebab stick.