Case Converter — Convert Text Case Online
Text case matters in coding, writing, and data processing. A variable named userId is camelCase; user_id is snake_case; UserId is PascalCase — different conventions for different languages and contexts. The free case converter on PublicSoftTools converts any text between uppercase, lowercase, title case, sentence case, camelCase, PascalCase, snake_case, and kebab-case instantly.
How to Use the Case Converter
- Open the case converter.
- Paste or type your text into the input box.
- Click the case format you want: UPPERCASE, lowercase, Title Case, Sentence Case, camelCase, PascalCase, snake_case, SCREAMING_SNAKE_CASE, or kebab-case.
- The converted text appears instantly in the output area.
- Click Copy to copy the result to your clipboard.
All Case Formats Explained
| Format | Example | Description | Common uses |
|---|---|---|---|
| UPPERCASE | HELLO WORLD | All characters capitalised | Acronyms (NASA, HTML), constants in code (MAX_SIZE), emphasis, form labels |
| lowercase | hello world | All characters small | URLs, email addresses, CSS class names, general data normalisation |
| Title Case | Hello World | First letter of each word capitalised | Article headings, book titles, proper names, navigation menu items |
| Sentence case | Hello world | Only first letter of first word capitalised | General writing, blog posts, standard sentence formatting |
| camelCase | helloWorld | No spaces; first word lower, subsequent words start with uppercase | JavaScript / TypeScript variables and functions, JSON keys, Java method names |
| PascalCase | HelloWorld | No spaces; every word starts with uppercase | JavaScript / TypeScript class names, React component names, C# types and methods |
| snake_case | hello_world | Words separated by underscores, all lowercase | Python variables and functions, database column names, file names on Linux/macOS |
| SCREAMING_SNAKE_CASE | HELLO_WORLD | Words separated by underscores, all uppercase | Constants in Python (MAX_RETRIES), environment variables (DATABASE_URL), C preprocessor macros |
| kebab-case | hello-world | Words separated by hyphens, all lowercase | URLs and slugs (/about-us), HTML attributes (data-user-id), CSS classes, npm package names |
| Train-Case | Hello-World | Words separated by hyphens, each word capitalised | HTTP headers (Content-Type, X-Request-Id), some configuration formats |
Naming Conventions by Programming Language
| Language | Variables | Constants | Classes / Types | Files |
|---|---|---|---|---|
| JavaScript / TypeScript | camelCase | SCREAMING_SNAKE_CASE | PascalCase | camelCase or kebab-case |
| Python | snake_case | SCREAMING_SNAKE_CASE | PascalCase | snake_case |
| Java | camelCase | SCREAMING_SNAKE_CASE | PascalCase | PascalCase (matches class name) |
| C# | camelCase (private), PascalCase (public) | PascalCase | PascalCase | PascalCase |
| Go | camelCase | camelCase or PascalCase | PascalCase (exported types) | snake_case |
| Rust | snake_case | SCREAMING_SNAKE_CASE | PascalCase (structs/enums) | snake_case |
| CSS / HTML | kebab-case (classes, IDs) | — | kebab-case | kebab-case |
| Database (SQL) | snake_case (columns, tables) | UPPERCASE (SQL keywords) | snake_case | — |
Why Naming Conventions Matter
Naming conventions are not arbitrary style preferences — they serve practical purposes in software development:
- Readability: Code is read far more often than it is written. Consistent naming reduces the cognitive load of parsing code at a glance.
getUserByIdreads more naturally thanget_user_by_idin JavaScript context; vice versa in Python. - Tooling compatibility: Many tools depend on convention. Python linters flag PEP 8 violations. React's JSX transpiler distinguishes components (PascalCase) from HTML elements (lowercase). CSS pre-processors handle kebab-case class names correctly where camelCase would cause parsing issues.
- Team collaboration: A consistent codebase lets team members read each other's code without style friction. Code review can focus on logic rather than formatting debates.
- Language ecosystem fit: Each language community has established conventions. Code that violates them feels foreign to contributors — the Rust compiler even warns on naming violations, treating convention as a correctness concern.
Title Case Rules
Title case is more complex than simply capitalising every word. Different style guides have different rules:
- AP Style (Associated Press): Capitalise all words of four or more letters. Articles (a, an, the), coordinating conjunctions (and, but, or), and short prepositions are lowercase unless they are the first or last word.
- Chicago Style: Similar to AP but more conservative — prepositions of all lengths are lowercase. Verbs, adjectives, adverbs, and nouns always capitalised.
- APA Style: Capitalise major words; lowercase articles, prepositions, and conjunctions of fewer than four letters.
- Simple title case: Capitalise the first letter of every word — the simplest rule and what most online converters implement.
The case converter uses simple title case (capitalise every word) — appropriate for most practical uses like headings, navigation labels, and article titles where strict editorial style is not required.
Case Conversion in Data Processing
Case conversion is a common data cleaning step when working with data from different sources:
- Normalising database entries: User-entered data often has inconsistent capitalisation (JOHN SMITH, john smith, John Smith). Lowercasing before storing, then formatting for display ensures consistency.
- URL slug generation: Converting article titles to URL-safe slugs requires lowercasing and replacing spaces with hyphens: "My Blog Post" → "my-blog-post". This is exactly kebab-case.
- API response formatting: Renaming JSON keys from snake_case (database convention) to camelCase (JavaScript convention) — or vice versa — is handled by serialisation libraries but sometimes needs manual conversion.
- Spreadsheet cleanup: Imported data with mixed case in names, addresses, or categories needs normalising before analysis or import into a new system.
- Code migration: Refactoring code that switches naming conventions — e.g., migrating a codebase from snake_case to camelCase — is a bulk case conversion task.
Sentence Case vs. Title Case
This is one of the most common formatting decisions in content and UI work:
- Sentence case (only first word capitalised) feels more conversational and is the modern default for UI labels, button text, and web content. Google's Material Design and Apple's Human Interface Guidelines both recommend sentence case for most UI elements.
- Title case (major words capitalised) is traditional for article headlines, book titles, and navigation in more formal contexts. Newspapers, books, and academic publishing use title case for headings.
Modern SaaS products (Notion, Linear, Figma) have largely moved to sentence case for UI text — it is considered more readable at scale. News sites and media publications still use title case for article headlines. Consistency within a context matters more than which style you choose.
camelCase in JavaScript: Why It Became Standard
JavaScript's built-in APIs use camelCase throughout (getElementById, addEventListener, innerHTML). When the language's standard library sets a convention, the ecosystem follows. Early influential libraries (jQuery) reinforced camelCase. JSON (JavaScript Object Notation) conventionally uses camelCase keys to match JavaScript variable naming, making JSON response parsing seamless without key transformation. The result is a deeply entrenched convention that has spread to adjacent ecosystems (Node.js, TypeScript, React).
Python's equivalent is snake_case — the standard library uses it throughout, PEP 8 formalised it, and tools like Black auto-enforce it. The convention is so consistent in Python that violating it in a Python codebase stands out immediately.
Common Questions
Does camelCase or PascalCase affect performance?
No. Naming convention has zero effect on runtime performance — it is purely a human readability concern. Compilers and interpreters treat identifiers as opaque strings regardless of their casing. The choice of case style affects code maintainability and convention compliance, not execution speed.
What is the difference between camelCase and dromedaryCase?
They are the same thing — camelCase is sometimes called dromedaryCase (after the one-humped dromedary camel) to distinguish it from PascalCase (sometimes called UpperCamelCase or BumpyCase). Both refer to the same convention: no spaces, each subsequent word starts with a capital letter. In common usage, "camelCase" almost always means lower camelCase (first word lowercase), with PascalCase used explicitly when the first word should also be capitalised.
How do I convert a long block of code to snake_case?
Paste the entire code block into the case converter and select snake_case — it processes multi-word inputs and handles spaces as word boundaries. For a full codebase rename (e.g., migrating Python variable names), IDE refactoring tools (VS Code, PyCharm) with find-and-replace using regex are more precise — they can rename all references to a variable simultaneously. The converter is best for text blocks, headings, spreadsheet data, and variable name brainstorming.
Convert Text Case Now
Paste any text to convert between UPPERCASE, lowercase, Title Case, camelCase, snake_case, PascalCase, and kebab-case instantly.
Open Case Converter