BasicApps Logo
Case Converter

Convert text between uppercase, lowercase, title case and more

43 characters

Capitalization in code isn't cosmetic — in some languages it breaks things entirely

React can't distinguish between a native HTML element and your own component unless the component name starts with a capital letter. That's not a convention. That's the rule. Write <button> and JSX renders a browser button. Write <Button> and it calls your component. Get it wrong and nothing throws — you just get silent, wrong output. PostgreSQL is the same way: any unquoted identifier gets folded to lowercase internally, so a column named UserID becomes userid the moment the query runs. These conventions exist for technical reasons, not style reasons.

camelCase — JavaScript, Java, Swift

First word all lowercase, each following word capitalized, no separators at all. JS variables and functions live here: getUserName, parseResponse, isLoggedIn. Java methods follow the same rule. So does Swift. JSON keys from JS-based APIs use camelCase because JSON.stringify serializes property names exactly as they appear in the object. Classes and types in these same languages use PascalCase instead — so userProfile is a variable, UserProfile is a class, and mixing them up causes real confusion in code review.

snake_case — Python, Ruby, PostgreSQL

All lowercase, underscores separating words. PEP 8 — Python's style guide, published in 2001 — mandated this for variables and function names. Ruby adopted the same pattern by community agreement. For PostgreSQL, it's not a preference at all: the database engine silently converts unquoted identifiers to lowercase at query time. So SELECT UserID FROM users actually runs as SELECT userid FROM users. If your column is named userid that works. If it isn't, you get a confusing "column does not exist" error and a ten-minute detour.

PascalCase — C#, .NET, React components

Every word capitalized, no separators. Microsoft's Framework Design Guidelines have required PascalCase for all public types, members, and namespaces in C# and .NET since the guidelines were first published in 2005. In React it's the JSX rule that separates your code from the browser's: lowercase tag = native HTML element, uppercase first letter = your component. Drop that capital and React silently renders an unknown HTML tag instead of running your code. No error. Just wrong behavior.

SCREAMING_SNAKE_CASE — constants and env variables

All uppercase, underscores between words. Compile-time constants use it (MAX_RETRIES, BUFFER_SIZE), and so does every environment variable you've ever seen (DATABASE_URL, API_KEY, NODE_ENV). The uppercase-env-var convention comes from POSIX shell rules dating back to the 1980s. Every language that reads .env files or calls os.environ inherited this convention, whether the language designers thought about it or not.

kebab-case — CSS, HTML attributes, URL slugs

All lowercase, hyphens between words. Every CSS property you've ever typed uses it: background-color, font-size, border-radius. HTML custom data attributes use it too: data-user-id. URL slugs follow the same pattern, and here there's a concrete SEO reason: Google treats hyphens as word separators when indexing. It treats underscores as word-joiners. /blog/my-first-post gets indexed as three searchable words. /blog/my_first_post gets indexed as one. That difference actually affects rankings.

Title Case: three major style guides, three completely different rule sets

Chicago Manual of Style capitalizes every word except articles, prepositions under 5 letters, and coordinating conjunctions — unless one of those opens the title. APA capitalizes anything 4+ letters long. AP Style capitalizes prepositions of 4+ letters ("With," "From," "Into") but lowercases shorter ones. They disagree enough that "Over the River" is correct in AP and wrong in Chicago. For web content with no required guide, Chicago is the most common default. Pick one and stick with it across the site.