What Is a Case Converter?
A case converter rewrites text from one naming convention to another: camelCase,
snake_case, kebab-case, and Title Case. Each style takes the
same underlying words and joins them with different capitalization and separator rules. The value of
conversion is that different tools, languages, and platforms require different styles — a
variable that is perfectly readable as my_variable_name in Python is illegal or
convention-breaking in JavaScript, where the same identifier should be written
myVariableName. Instead of retyping every identifier by hand, a case converter applies the
rules instantly and consistently, which is faster and — more importantly — free of typos.
The Four Case Styles
| Style | Example | Used For |
|---|---|---|
| camelCase | userProfilePicture | JavaScript/TypeScript variables and functions |
| snake_case | user_profile_picture | Python, Ruby, database columns, file names |
| kebab-case | user-profile-picture | CSS classes, URL slugs, file names on the web |
| Title Case | User Profile Picture | Headings, labels, and human-readable titles |
Note that PascalCase (also called UpperCamelCase) — the convention for class names and
React components — is the same as camelCase but with an uppercase first letter. Because Title Case
capitalizes every word, converting hello world to Title Case gives you
Hello World, and then removing the spaces by hand gives you PascalCase. This tool's
camelCase output can be turned into PascalCase simply by capitalizing its first letter.
Why and When You Need a Case Converter
- Cross-language porting: moving code (or a data schema) between languages that use
different conventions — e.g. adapting Python's
snake_caseAPI responses into JavaScript'scamelCaseobjects. - Database to code mapping: converting column names like
created_atinto the camelCase properties your ORM or frontend expects. - CSS and file naming: turning a product name into a consistent kebab-case slug for class names, URLs, or image assets.
- Environment variables and configs: normalizing mixed-case input into one style before it is used as a key, flag, or identifier.
- Fixing legacy or imported data: cleaning up identifiers that were typed
inconsistently (
userName,user_name,USERNAME) into a single convention across a dataset.
How the Conversion Works
Conversion happens in two steps: tokenization, then re-joining. First
the input is split into words. The tokenizer treats spaces, hyphens, underscores, dots, and slashes as
word boundaries, and it also detects two invisible boundaries: an uppercase letter following a
lowercase letter or digit (myVariable → my + Variable), and an
acronym followed by a capitalized word (XMLParser → XML +
Parser). This means the input can be written in any style and still convert
correctly — the tool does not care whether you paste hello world,
hello_world, hello-world, or helloWorld.
Then the words are re-joined: camelCase lowercases the first word and capitalizes each following word;
snake_case and kebab-case lowercase everything and join with _ or -; Title
Case capitalizes every word and joins with spaces. Because the tokenizer is what makes the output
correct, the reference table below is the best way to see how edge cases like acronyms, digits, and
mixed separators behave.
Step-by-Step: From Messy Input to Clean Output
Walking through one example shows exactly why the tokenizer matters. Take
camelCaseXMLParser. First, the acronym rule inserts a space before
Parser: camelCaseXML Parser. Then the camel boundary rule splits
camelCase into camel Case, giving camel Case XML Parser.
After separator normalization and splitting, the word list is
["camel", "Case", "XML", "Parser"]. From here each style is a simple join: camelCase
lowercases the first word and capitalizes the rest (camelCaseXmlParser); snake_case and
kebab-case lowercase every word and join with _ or -
(camel_case_xml_parser, camel-case-xml-parser); Title Case capitalizes every
word (Camel Case Xml Parser). Whatever messy style you paste in — mixed separators,
leading or trailing whitespace, all caps, nested camel boundaries — the same pipeline normalizes it.
Naming Conventions Across Languages and Platforms
Conventions are not arbitrary — they are the established rules of each ecosystem, usually enforced by linters and code review. Writing in the wrong style for the platform is a common source of churn in pull requests, so converting to the local convention before committing saves everyone time.
| Language / Platform | Convention | Example |
|---|---|---|
| JavaScript / TypeScript | camelCase variables & functions, PascalCase classes | getUserById, UserProfile |
| Python / Ruby | snake_case for functions and variables | get_user_by_id |
| SQL databases | snake_case for tables and columns | user_profile |
| CSS / HTML | kebab-case for class names | .user-profile-card |
| Go | mixedCaps (camelCase) | GetUserByID |
| Rust | snake_case (lower) | get_user_by_id |
| Environment variables | UPPER_SNAKE_CASE | API_BASE_URL |
Reference Table
| Input | camelCase | snake_case | kebab-case | Title Case |
|---|---|---|---|---|
| hello world | helloWorld | hello_world | hello-world | Hello World |
| camelCaseXMLParser | camelCaseXmlParser | camel_case_xml_parser | camel-case-xml-parser | Camel Case Xml Parser |
| spaced--out__text.dotted | spacedOutTextDotted | spaced_out_text_dotted | spaced-out-text-dotted | Spaced Out Text Dotted |
| already_snake_case | alreadySnakeCase | already_snake_case | already-snake-case | Already Snake Case |
| version2.0 | version20 | version2_0 | version2-0 | Version2 0 |
| HTTPServer | httpServer | http_server | http-server | Http Server |
Paste any row's input into the tool above to confirm the four outputs match, or use the converter to double-check a naming question before it goes into a codebase.
Troubleshooting & Practical Tips
Conversion Is Lossy — Keep Your Original
The converter cannot recover the exact input once it has been converted, because multiple inputs map
to the same output (both hello world and hello_world become
helloWorld). If you are converting text that matters — an API contract, a config key, a
file name — keep a copy of the source before you overwrite anything.
Acronyms Come Out as Title Case
XMLParser becomes xmlParser, not xMLParser. This is intentional
and matches the most common style guides (including Google's), which say acronyms inside identifiers
are written in title case. If your team instead keeps acronyms fully uppercase in camelCase
(XMLParser), that is a stylistic choice the tool does not automate — adjust the output
by hand in that case.
Empty and Separator-Only Input
Pasting only separators (like ---) or whitespace produces empty outputs — there are no
words to convert. That is expected behavior, not a bug.
Whole Files and Bulk Names
The tool converts whatever you paste, so it works equally well for a single identifier and for a whole block of names — newlines are treated as separators, so a list pasted one name per line converts cleanly as one batch. That makes it handy for renaming a set of database columns, CSS classes, or environment variables consistently: paste the whole list, copy the converted block, and paste it back over the original. For file renames on disk, convert each name here first, then use your operating system's batch-rename feature with the converted values — a quick way to keep dozens of assets in one style without retyping any of them.