The exact same concept — “user profile settings” — is written userProfileSettings in JavaScript, user_profile_settings in Python and PostgreSQL, UserProfileSettings as a React component or Go struct, user-profile-settings in a URL or CSS class, and USER_PROFILE_SETTINGS in a .env file. Choosing the right case style makes code idiomatic and prevents subtle bugs in case-sensitive databases, routers, and file systems. This guide maps every major case convention, handles tricky acronyms and Unicode edge cases, and gives practical rules for SEO-friendly URL slugs.

The complete case convention map

StyleExampleWhere it belongs
camelCaseuserProfileSettingsJavaScript, TypeScript, Java, Swift, Dart variables & functions; many JSON APIs
PascalCaseUserProfileSettingsClasses, interfaces, enums, React/Vue components, C# methods, exported Go identifiers
snake_caseuser_profile_settingsPython, Ruby, Rust, PHP variables; SQL tables & columns; Stripe/GitHub REST payloads
CONSTANT_CASEUSER_PROFILE_SETTINGSCompile-time constants, enum values, .env environment variables
kebab-caseuser-profile-settingsURLs, CSS classes & custom properties, HTML data-* attributes, CLI flags, npm packages
dot.caseuser.profile.settingsFlattened JSON keys, Java properties, i18n translation keys, metric names
Train-CaseUser-Profile-SettingsHTTP headers (Content-Type, Cache-Control)
path/caseuser/profile/settingsFile paths, route hierarchies, S3 object keys
Title CaseUser Profile SettingsArticle headlines, book titles, section titles in English
Sentence caseUser profile settingsUI buttons, form labels, navigation items, modern product headings

SnipFerry’s Case Converter supports 15 formats and detects word boundaries inside already-formatted identifiers — so parseHTTPResponse2 splits cleanly into parse_http_response_2 instead of breaking every capital letter into its own word.

The acronym dilemma: userId vs userID

Nothing starts longer code-review debates than acronyms inside identifiers: xmlHttpRequest vs XMLHTTPRequest, parseJSON vs parseJson, userId vs userID. Different ecosystems have settled on different answers:

  • Go explicitly prefers all-caps initialisms (UserID, HTTPClient, ServeHTTP) per Effective Go.
  • JavaScript, TypeScript, and C# (.NET) treat acronyms of three or more letters as regular words (HttpClient, XmlParser, userId) so adjacent acronyms never collide into unreadable walls like HTMLURLParser.
  • Python and SQL sidestep the problem entirely with snake_case: http_client, user_id, xml_parser are unambiguous everywhere.

Whichever rule your team picks, document it in your linter config (ESLint, Ruff, Checkstyle) and never mix both inside the same API response.

Converting case across API, database, and front-end boundaries

A common full-stack architecture uses snake_case in PostgreSQL, snake_case in Python or Go structs, and camelCase in TypeScript and React. The mistake teams make is sprinkling ad-hoc renames inside every component. Instead, translate once at the serialization boundary:

  • In Go, use struct tags: CreatedAt time.Time `json:"createdAt"`.
  • In Python Pydantic, configure alias_generator=to_camel on the base model.
  • In SQL, keep table and column names strictly lowercase snake_case without quotes — PostgreSQL folds unquoted identifiers to lowercase while Oracle folds to uppercase, and quoted mixed-case column names force every future query to wrap them in double quotes.
  • In JSON schemas and codegen, tools like JSON to TypeScript and JSON to Go preserve wire field names while emitting idiomatic language identifiers.

Title Case vs Sentence case in UI and copy

In English Title Case, major words are capitalised while short minor words (a, an, the, and, but, for, nor, or, of, in, on, to, at, by) stay lowercase unless they appear first or last in the title: “How to Count Words and Characters”. In Sentence case, only the first word and proper nouns are capitalised: “How to count words and characters”. Most modern web interfaces prefer Sentence case for buttons, labels, and settings because it is faster to scan and avoids awkward edge cases with brand names and technical terms like iOS or npm.

URL slugs: turning titles into durable web addresses

A URL slug is the human-readable identifier at the end of a web address, such as /guides/how-to-clean-messy-csv-data. Clear slugs help visitors judge a link before clicking, make URLs easier to read in analytics and server logs, and give search engines a clean semantic signal. The Slug Generator converts single titles or bulk lists line by line:

10 Tips for Better Sleep & Focus (2026)  →  10-tips-for-better-sleep-and-focus-2026
Café Crème: A Guide                      →  cafe-creme-a-guide
C++ & C# Basics — Part 1                 →  c-and-c-basics-part-1

Seven rules for slugs that age well

  1. Use lowercase and hyphens, never underscores. Google treats hyphens (-) as word separators and underscores (_) as word joiners. Lowercase prevents duplicate URLs on case-sensitive Linux servers where /About and /about are distinct paths.
  2. Transliterate accents cleanly to ASCII. Decompose accented Latin letters (é → e, ü → u, ñ → n, ß → ss, ø → o) so URLs do not explode into ugly percent-encoded sequences like caf%C3%A9 when shared on social media or pasted into spreadsheets.
  3. Keep slugs to 3–6 meaningful words. Long slugs get truncated in search results and break across lines in emails. Turning on stop-word removal drops filler like “the”, “of”, and “a” when the slug stays natural without them.
  4. Leave years and counts out of evergreen URLs. Putting -2026 or -10-tips in the slug creates a dilemma next year when you update the article to 12 tips for 2027: either the URL lies, or you have to change it and manage redirects.
  5. Never change a live slug without a 301 redirect. Changing a URL drops every bookmark, backlink, and indexed page unless the old path returns an HTTP 301 Moved Permanently straight to the new canonical URL.
  6. Avoid trailing punctuation or doubled hyphens. Collapse repeated delimiters (-- → -) and trim leading or trailing hyphens caused by parentheses or trailing exclamation marks.
  7. Check for route collisions. Keep user-generated slugs under a prefix like /posts/:slug rather than at the root so a user cannot create a slug named login, admin, or sitemap.xml.

Building URLs with query parameters or non-ASCII text? Read URL Encoding Explained, or tidy multi-line title lists before generating slugs with How to Clean Up Messy Text.