What Is a Case Converter?
A case converter is a small utility that rewrites text into a different naming style. Programmers use it constantly: switching a variable from camelCase to snake_case when porting code from JavaScript to Python, generating CONSTANT_CASE environment variable names from a feature description, or producing a kebab-case CSS class from a component name. This tool covers every common case style in one panel — paste your text, and you get every variant at once.
Common Case Styles
| Style | Example | Where it’s used |
|---|---|---|
| camelCase | helloWorldExample | Variables and functions in JavaScript, Java, Kotlin, Swift |
| PascalCase | HelloWorldExample | Classes, types, components (React, C#, TypeScript) |
| snake_case | hello_world_example | Variables and functions in Python, Ruby, Rust |
| CONSTANT_CASE | HELLO_WORLD_EXAMPLE | Constants and environment variables everywhere |
| kebab-case | hello-world-example | URLs, CSS classes, HTML attributes, CLI flags |
| COBOL-CASE | HELLO-WORLD-EXAMPLE | HTTP headers (in some style guides), legacy COBOL |
| Train-Case | Hello-World-Example | Some HTTP headers (Content-Type), book titles |
| Title Case | Hello World Example | Article titles, UI labels |
| Sentence case | Hello world example | Body copy, button labels (modern UI guidelines) |
| dot.case | hello.world.example | Java package names, config keys |
| path/case | hello/world/example | URL paths, file system paths |
How to Convert Cases
- Paste any text into the input area — a single identifier, a sentence, or many lines at once.
- Press
Ctrl+Enteror click the Convert button. The output panel shows every case variant. - Copy the line you need. The whole table copies with one click via the Copy button or
Ctrl+Shift+C. - Type to convert in real time — the tool re-converts on every keystroke (debounced) so you can iterate quickly.
The conversion is fully bidirectional. You can paste helloWorldExample, hello_world_example, hello-world-example or Hello World Example — the tool detects the original style by scanning for word boundaries and re-emits the value in every other style.
How Word Boundaries Are Detected
A robust case converter has to recognize where words begin and end no matter how the input is formatted. This tool uses three rules:
- Separator characters — underscores (
_), hyphens (-), spaces, dots (.), and slashes (/) split the input into words. - Case transitions — a lowercase letter followed by an uppercase letter starts a new word (
helloWorld→hello,World). - Acronym handling — a sequence of uppercase letters followed by a lowercase letter splits before the last uppercase (
XMLHttpRequest→XML,Http,Request). This matters when you convert acronym-heavy code.
Numbers stay attached to the surrounding word (getHTML5Player → getHtml5Player or get_html5_player), which is what most style guides prescribe.
camelCase vs snake_case
This is the most-Googled case-conversion question. The answer is mostly cultural, not technical:
- JavaScript, TypeScript, Java, Kotlin, Swift, C# — community style guides and language conventions favor camelCase for variables and methods. The standard library is camelCase. Frameworks like React lean on PascalCase for components and camelCase for props.
- Python and Ruby — PEP 8 (Python) and the Ruby community guide both prescribe snake_case for variables, functions and module names. PascalCase is reserved for classes; CONSTANT_CASE for constants.
- Rust and Go — Rust uses snake_case for items and PascalCase for types. Go uses MixedCaps (essentially PascalCase for exported, camelCase for unexported) and lints any deviation.
- C and C++ — historically snake_case in the standard library and many older codebases; many modern style guides allow either.
- SQL — most teams use snake_case for table and column names because identifiers are case-insensitive in many engines and quoting mixed-case is awkward.
When in doubt: read the existing code in the repo and match its style. Consistency inside one project beats any abstract preference for one style over another.
Common Mistakes When Converting Case
- Losing acronym capitalization — naive conversion turns
parseHTMLintoparsehtmlinstead ofparse_html. Use a converter that recognizes acronym runs. - Concatenating numbers into separate words —
mp3Playershould becomemp3_player, notmp_3_player. Most style guides keep digits glued to the preceding word. - Mangling Unicode letters — accented characters like
éandñshould keep their case-folding behavior. This tool uses JavaScript’stoLowerCase()andtoUpperCase(), which respect Unicode rules. - Trimming meaningful separators — converting a file path like
src/components/Button.tsxshould preserve the path structure, not flatten it. If you’re working with paths, use the dedicatedpath/caseoutput.
When to Use This Tool
- Porting code between languages — translate a Python API to TypeScript, or the other way around, and rename every identifier.
- Generating environment variable names — turn a feature description like “stripe webhook secret” into
STRIPE_WEBHOOK_SECRET. - Building CSS class names from component names —
UserProfileCard→user-profile-card. - Cleaning up a CSV header row —
First Name,Last Name,Email Address→first_name,last_name,email_addressfor SQL ingestion. - Renaming a batch of identifiers — paste an entire list, get the converted output, paste it back.
Everything runs locally in your browser. No data leaves your machine, which means you can safely paste internal identifiers, API endpoints or proprietary feature names without worrying about a third-party server logging them.