Case Converter
Convert text between any case format instantly.
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
- camelCase — JavaScript variables and functions:
myVariableName - PascalCase — class names in most languages:
MyClassName - snake_case — Python variables, database columns:
my_variable_name - kebab-case — CSS classes, HTML attributes, URL slugs:
my-variable-name - SCREAMING_SNAKE_CASE — constants in Python, C, Java:
MAX_RETRY_COUNT - Title Case — headings and proper nouns:
My Document Title
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.
- VS Code — Command Palette > "Transform to Uppercase/Lowercase/Title Case"
- Vim/Neovim — gU (uppercase), gu (lowercase), g~ (toggle) applied to any motion
- Python — str.upper(), str.lower(), str.title(), str.capitalize()
- JavaScript — str.toUpperCase(), str.toLowerCase(); no built-in title case; use a library
Frequently Asked Questions
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.echo "text" | tr '[:lower:]' '[:upper:]'. Python: "text".upper(). JavaScript: "text".toUpperCase(). In Microsoft Word: select text and press Shift+F3 to cycle through cases.