Python ships with six built-in string methods that change case: .lower(), .upper(), .title(), .capitalize(), .swapcase(), and .casefold(). Each one takes the original string, applies a deterministic rule to every character, and returns a new string — strings in Python are immutable, so the original is never modified. These methods cover the everyday jobs: lowercasing user input before comparison, uppercasing a constant for display, capitalizing the first letter of a sentence, and swapping case for stylistic effect. But the moment you need snake_case to camelCase, or PascalCase to kebab-case, the built-ins stop helping because capitalization in identifiers is syntactic — a single wrong letter breaks the code. That is exactly when a browser-based tool like Case Converter becomes the practical shortcut, re-tokenizing your input across spaces, underscores, hyphens, and camelCase boundaries, then re-emitting it in any of ten styles side by side. The rest of this guide walks through each Python method, shows exactly what it returns, and explains when you should reach for the tool instead.

Python's Six Built-in String Case Methods
Every case conversion you can do with stock Python comes from one of six methods on the str type. They are available on any string without importing anything, which is why they show up in nearly every codebase and tutorial.
- .lower() — returns a copy of the string with every cased character mapped to lowercase. Used most often to normalize user input before comparison or storage.
- .upper() — returns a copy with every cased character mapped to uppercase. Common for log messages, banner text, and constant-like display strings.
- .title() — returns a copy with the first letter of each word capitalized and the remaining letters lowercased. Words are defined by non-alphabetic boundaries.
- .capitalize() — returns a copy with only the first character uppercased and every other character lowercased, regardless of where word boundaries fall.
- .swapcase() — returns a copy with uppercase letters converted to lowercase and lowercase letters converted to uppercase.
- .casefold() — returns a copy aggressively normalized for caseless matching. It goes further than .lower() on characters that have no direct lowercase equivalent in ASCII.
Because strings are immutable, every method above returns a new string. Calling "Hello".lower() does not turn the original literal into "hello"; it produces a fresh value that you have to assign, return, or pass somewhere to use.
What Each Python Method Returns
The table below uses "Hello World" as a baseline so the difference between methods is visible at a glance. Paste any of these outputs into a Python REPL and the values match.
| Method | Call | Result |
|---|---|---|
| .lower() | "Hello World".lower() | "hello world" |
| .upper() | "Hello World".upper() | "HELLO WORLD" |
| .title() | "hello world".title() | "Hello World" |
| .capitalize() | "hello world".capitalize() | "Hello world" |
| .swapcase() | "Hello World".swapcase() | "hELLO wORLD" |
| .casefold() | "Straße".casefold() | "strasse" |
The last row matters: .lower() leaves "Straße" as "straße", while .casefold() folds the sharp-s into two s characters. That is the rule of thumb — .lower() for display, .casefold() for caseless comparison across languages.
Why Built-in Methods Can't Handle Naming Conventions
The six methods above are designed for written language. They know about letters and they know about spaces. They do not know that an underscore in user_email_address is a word separator, or that the capital H inside getHttpResponse is a camelCase boundary. Ask Python to turn "user_email_address" into camelCase with built-ins alone and you end up writing a small helper that splits on the underscore, capitalizes each part after the first, and concatenates the result.
That snippet handles a single separator and ignores hyphens, punctuation, digits glued to words, and acronym-rich PascalCase inputs like HTMLParser. Every real codebase reinvents this small function slightly differently, and every version breaks on a slightly different edge case. Naming-style conversion is a parsing problem more than a casing problem, and Python's built-ins simply do not parse.
The same limitation blocks the other direction. If you start with "hello-world-example", no combination of .upper(), .lower(), and .title() will give you helloWorldExample in one call. You either split, capitalize, and rejoin by hand, or you reach for a tool that already does that reliably.
Convert Case in Python Without Writing Code
For one-off conversions — renaming a variable, drafting a slug, normalizing a column of API field names — the fastest path is a browser tool. Case Converter re-tokenizes your text across spaces, underscores, hyphens, punctuation, and camelCase boundaries, then shows every common writing and naming style in one panel. Here is how to use it.
- Open Case Converter in your browser.
- Type or paste your Python identifier, sentence, or heading into the input box.
- Read the panel below: every one of the ten output styles updates instantly as you type or paste, so there is no submit button to click.
- Compare the variants side by side. snake_case, camelCase, PascalCase, kebab-case, and CONSTANT_CASE all appear together, along with UPPERCASE, lowercase, Title Case, Sentence case, and an alternating style.
- Click Copy next to the variant you want, and paste it straight into your editor, terminal, or config file.
Everything runs locally in JavaScript, so nothing leaves the page. That matters when the identifier you are converting contains an internal name, a secret key fragment, or a database column you would rather not upload.
Naming Conventions Python Developers Actually Use
PEP 8, the Python style guide, is explicit about which case goes where. The table below is a condensed reference; the exact rules live in the Python Enhancement Proposal itself.
| Identifier Type | Convention | Example |
|---|---|---|
| Module name | short, all lowercase | requests |
| Package name | short, all lowercase | pandas |
| Function name | snake_case | calculate_total() |
| Variable name | snake_case | user_count |
| Constant | UPPER_SNAKE_CASE | MAX_RETRIES |
| Class name | CapWords (PascalCase) | HttpRequest |
| Exception name | CapWords, ends in Error | ValueError |
| Method name | snake_case | to_camel() |
| Instance method first arg | self | def parse(self, text): |
| Class method first arg | cls | def from_dict(cls, data): |
When you are rewriting code from one convention to another — for instance, translating a JavaScript SDK that uses camelCase into a Python package that needs snake_case — the bottleneck is reliably getting every identifier right. A re-tokenizing tool is the safest way to convert in bulk, because once you confirm the parsing is correct for one name, the same input always produces the same output.
Choosing Between Python Methods and a Browser Tool
Use Python's built-ins when the conversion is part of the program's logic — normalizing input, formatting output, comparing values case-insensitently. They are cheap, dependency-free, and easy to read in a code review.
Reach for a browser tool when the conversion is a one-time chore: a single identifier to rename, a heading to format, a column of API fields to migrate from camelCase JSON to snake_case database columns. The risk in those jobs is not the code — it is the typo. Seeing ten output styles at once and copying exactly the one you want removes that risk.
If you also need to measure the result before pasting it into a form or a SQL WHERE clause, the Character Counter gives you a live length alongside your typed text without any upload. Together, the two tools cover most of what case conversion is asked to do outside an actual Python script.