Skip to content

Case Converter

Convert any text between 14 common programming and writing cases — all in one place, all in your browser.

Last updated:

camelCase
helloWorldFooBar
PascalCase
HelloWorldFooBar
snake_case
hello_world_foo_bar
CONSTANT_CASE
HELLO_WORLD_FOO_BAR
kebab-case
hello-world-foo-bar
Train-Case
Hello-World-Foo-Bar
Title Case
Hello World Foo Bar
Sentence case
Hello world foo bar
dot.case
hello.world.foo.bar
path/case
hello/world/foo/bar
no case
hello world foo bar
sWaP cAsE
HELLOwORLDfOObAR
UPPER CASE
HELLOWORLDFOOBAR
lower case
helloworldfoobar

Naming Conventions by Language

Every programming language and ecosystem has settled on preferred naming conventions. Using the wrong case in a codebase does not just look inconsistent — it can break tooling, confuse collaborators, and violate linter rules that block your commits.

  • camelCase — the default in JavaScript, TypeScript, and Java for variables and function names. The first word is lowercase; every subsequent word is capitalized: getUserName.
  • snake_case — preferred by Python (PEP 8), Ruby, Rust, and most SQL dialects: get_user_name.
  • PascalCase — used for class names in C#, Java, and TypeScript, and for React component names: GetUserName.
  • kebab-case — the standard for CSS class names, HTML attributes, URL slugs, and CLI flags: get-user-name.
  • CONSTANT_CASE — reserved for environment variables, compile-time constants, and enum values across most languages: MAX_RETRY_COUNT.

Knowing which convention belongs where saves time during code reviews and keeps your project consistent without relying on memory alone.

When Case Conversion Matters

Case conversion is not just a cosmetic preference. It comes up in several practical scenarios that developers encounter daily.

  • API field mapping — A JSON response from a Ruby backend uses snake_case keys, but your React frontend expects camelCase. Automated conversion at the boundary layer keeps both sides idiomatic.
  • Database column naming — PostgreSQL folds unquoted identifiers to lowercase, so snake_case is the safest choice for column names. Migrating from a camelCase ORM schema means bulk-converting every column.
  • URL slug generation — Titles like "How It Works" need to become how-it-works for clean, SEO-friendly URLs. Kebab-case is the universal standard for URL paths.
  • Code style enforcement — Linters like ESLint (camelcase rule), Pylint, and RuboCop flag incorrect casing as errors. Converting identifiers before pasting code into a new project avoids a wall of lint warnings.
  • Environment variables — Shell conventions dictate CONSTANT_CASE for exported variables. Converting a config key like databaseUrl to DATABASE_URL is a one-step operation with this tool.

The 14 Cases This Tool Supports

This converter handles every mainstream naming convention plus several utility transforms. Given the input hello world example, here is what each case produces:

  • camelCasehelloWorldExample. First word lowercase, subsequent words capitalized, no separator.
  • PascalCaseHelloWorldExample. Every word capitalized, no separator.
  • snake_casehello_world_example. Words joined with underscores.
  • CONSTANT_CASEHELLO_WORLD_EXAMPLE. All uppercase with underscore separators.
  • kebab-casehello-world-example. Words joined with hyphens.
  • Train-CaseHello-World-Example. Capitalized words joined with hyphens, common in HTTP headers.
  • Title CaseHello World Example. Every word capitalized, separated by spaces.
  • Sentence caseHello world example. Only the first word capitalized.
  • dot.casehello.world.example. Words joined with dots, used in Java package names and property files.
  • path/casehello/world/example. Words joined with forward slashes, useful for file paths and routes.
  • no casehello world example. Plain lowercase words separated by spaces.
  • sWaP cAsE — inverts the case of every character. Hello becomes hELLO.
  • UPPER CASEHELLO WORLD EXAMPLE. The entire string in uppercase.
  • lower casehello world example. The entire string in lowercase.

The tool tokenizes your input by splitting on camelCase boundaries, underscores, hyphens, dots, slashes, and spaces — so you can paste text in any existing format and convert it to any other in one click.

Unicode and Locale Considerations

Case conversion looks simple until you encounter non-ASCII text. The most well-known pitfall is the Turkish I problem: in Turkish, the uppercase form of i is not I but İ (Latin capital I with a dot above), and the lowercase form of I is ı (dotless i). A naive toUpperCase() call using the default locale can silently corrupt identifiers if the browser or OS locale is set to Turkish or Azerbaijani.

German presents another edge case: the lowercase letter ß (Eszett) traditionally had no uppercase form and was uppercased as SS, changing the string length. Since 2017, Unicode includes the capital Eszett , but browser behavior varies.

This tool uses JavaScript's built-in toUpperCase() and toLowerCase() with the browser's default locale, and its tokenizer uses Unicode-aware regex patterns (\p{L}, \p{Lu}, \p{Ll}) so accented characters and non-Latin scripts are handled correctly during word splitting. For programming identifiers you will typically work with ASCII text where these locale issues do not apply, but it is worth knowing about them when processing user-facing strings.

Related Tools

If you are working with text transformation, these other CodeBoxTools utilities may help:

  • Slug Generator — converts titles and sentences into URL-safe slugs, handling Unicode transliteration and duplicate-slug suffixes.
  • JSON Formatter — paste minified JSON and get a pretty-printed, syntax-highlighted view. Useful when you need to inspect API payloads before converting their keys to a different case.
  • Diff Checker — compare the original and converted versions of a file side by side to verify that only the intended casing changes were made.

Frequently Asked Questions

What's the difference between camelCase and PascalCase?
Both concatenate words without spaces. The difference is the first letter: camelCase starts with a lowercase letter (`fooBarBaz`), PascalCase starts with uppercase (`FooBarBaz`). JavaScript and Java use camelCase for variables and methods, and PascalCase for class names.
How does the converter handle acronyms?
It splits acronyms at natural word boundaries. For example, `XMLHttpRequest` tokenizes into `xml`, `http`, `request` — so you get clean output in every target case. This matches how most code style guides treat acronyms.
Does it work with non-English text?
Yes. The tokenizer uses Unicode letter classes (`\p{L}`), so it correctly handles accented characters, Cyrillic, Greek, and other scripts.
What case styles are supported?
Fourteen styles including camelCase, PascalCase, snake_case, CONSTANT_CASE, kebab-case, Title Case, UPPERCASE, lowercase, Sentence case, dot.case, and path/case. Paste any text and see every variant at once.
How are acronyms like API or URL handled?
By default, acronyms are treated as single words, so `getAPIResponse` converts consistently. If your source uses acronym-preserving PascalCase (`GetAPIResponse`), the output will match.
Why do camelCase and snake_case both exist?
They are naming conventions from different language communities. Python and Ruby use snake_case; JavaScript, Java, and C# use camelCase; SQL and CSS use kebab-case. Sticking to one style per codebase is what matters most.

Related Tools