About the Case Converter

Text case conversion is needed constantly in software development, content editing, and data processing. Different naming conventions are required in different contexts: JavaScript variables use camelCase, database columns use snake_case, CSS classes use kebab-case, and constants use SCREAMING_SNAKE_CASE. Inconsistent casing in code or data pipelines can cause silent matching failures and hard-to-find bugs.

Naming conventions and their uses

Sentence case vs Title Case

Sentence case capitalises only the first word and proper nouns ("This is my heading"). Title Case capitalises the first letter of most words ("This Is My Heading"). Style guides differ: AP style capitalises major words; Chicago style capitalises all words except short prepositions and conjunctions.

Automatic case conversion in code

Most modern IDEs and code editors have built-in case conversion shortcuts. VS Code: select text, open Command Palette (Ctrl+Shift+P), type "Transform to". Vim: gU to uppercase, gu to lowercase, g~ to toggle. Sed: echo "TEXT" | sed 's/.*/\L&/' for lowercase.

Frequently Asked Questions

What is the difference between camelCase and PascalCase?
Both join words without spaces and capitalise the first letter of each word, except camelCase starts with a lowercase letter (myVariableName) while PascalCase starts with an uppercase letter (MyVariableName). PascalCase is also called UpperCamelCase.
When should I use snake_case vs kebab-case?
Use snake_case in Python, Ruby, and SQL column names. Use kebab-case in CSS class names, HTML data attributes, URL slugs, and many REST API conventions. They are conceptually the same pattern but ecosystem convention matters for readability and tooling compatibility.
How do I convert to Title Case in JavaScript?
str.split(" ").map(w => w.charAt(0).toUpperCase() + w.slice(1).toLowerCase()).join(" "). For proper Title Case that respects short words like "a" and "the", you need a more nuanced implementation or a library like the title-case npm package.
Why do programming languages have different naming conventions?
Each language community developed conventions independently, and most languages have official style guides (PEP 8 for Python, Google Style Guides for Java and JavaScript). Consistency within a codebase matters more than which convention you choose.
How do I convert text to uppercase on the command line?
Linux/Mac terminal: echo "text" | tr '[:lower:]' '[:upper:]'. Python: "text".upper(). JavaScript: "text".toUpperCase(). In Microsoft Word: select text and press Shift+F3 to cycle through cases.
Related tools
Ad