Case & Space Cleaner
Change case and clean up whitespace.
What is this tool?
Change the case of English letters or clean up extra spaces, line-edge spaces and blank lines in one click — handy for tidying documents, code and posts.
How to use it
Paste your text and press a button to transform it in place. Chain multiple transforms, then use Copy. Everything runs in your browser.
What each button does
- UPPER / lower: all English letters to upper or lower case.
- Title Case: capitalize the first letter of every word.
- Sentence: capitalize the first letter of each sentence.
- Squeeze / Trim / Strip / Drop blank lines: whitespace clean-up options.
Five programming case styles — when to use which
Naming conventions for variables, functions, and constants in code generally fall into five styles, each with its own conventional use.
| Style | Form | Typical use |
|---|---|---|
| camelCase | first word lowercase, later words capitalized, no separator | Variable/function names (JavaScript, Java, etc.) |
| PascalCase | every word capitalized, no separator | Class/component/type names |
| snake_case | lowercase, words joined with underscore | Variable/function names (Python), database columns |
| kebab-case | lowercase, words joined with hyphen | URL slugs, CSS class names, HTML attributes |
| CONSTANT_CASE | uppercase, words joined with underscore | Constants that never change (e.g. MAX_RETRY_COUNT) |
This tool provides general English case conversion and whitespace clean-up — it doesn't include dedicated automatic conversion between these five naming styles. Use the UPPER/lower/Title Case buttons in combination as a partial aid for cleaning up naming.
Language conventions — why projects differ
Even for the same kind of code, different language communities prefer different naming styles. JavaScript, Java, and C# ecosystems have settled on camelCase for variables/functions and PascalCase for classes as their standard style guides, while Python and Ruby communities' official guides (like PEP 8) recommend snake_case for variables and functions. Web front-ends commonly use kebab-case for URLs and CSS class names, since hyphens aren't treated as special characters in URLs or CSS selectors and read cleanly. In projects mixing multiple languages (e.g. a Python backend with a JavaScript frontend), each side typically follows its own convention, with a defined rule for auto-converting naming style at the API boundary where data crosses over.
Careful with batch conversion — handling acronyms
One thing to watch closely when batch-converting naming styles is how acronyms are handled. For a name containing "URL," converting to camelCase could produce either userURL or userUrl depending on the style guide. Google's JavaScript style guide recommends treating acronyms like ordinary words with only the first letter capitalized (userUrl), while some codebases keep acronyms fully capitalized (userURL). If an automated tool's rule doesn't match your project's convention, you can end up with unintended changes like "ID" becoming "Id" or "HTML" becoming "Html" — so it's safer to separately review any names containing acronyms after a batch conversion.