Case Converter

Switch variable names, database columns, URL slugs, and headlines between camelCase, snake_case, kebab-case, Title Case, PascalCase, and CONSTANT_CASE in real time. This free converter tokenizes mixed delimiters, respects acronym boundaries, checks code-safety rules, and runs entirely in your browser with zero data uploaded.

Developer & writer utility · 100% in-browser

Convert string and identifier case

Transform variables, database fields, URL slugs, and titles with live multi-format conversion, acronym recognition, and syntax safety checks.

  • camelCase & PascalCase
  • snake_case & CONSTANT
  • kebab-case URL Slugs
  • AP & Chicago Title Case

Input Text or Identifier

Enter single identifiers or paste multi-line lists of variables and slugs.

Length: 0 chars Target budget: 0–64 chars (SQL / Slug safe)

  • Tokens
    0
  • Characters
    0 → 0
  • Lines
    0

Safety Score & Result

Enter or paste text on the left to see your converted string, multi-case output, and syntax safety score.

0 Score
— Awaiting input
Primary Converted Output 0 characters
—

All Formats at a Glance

camelCase JS / TS / JSON
—
snake_case Python / SQL / Ruby
—
kebab-case URLs / CSS / Slugs
—
Title Case Headlines / AP / Chicago
—
PascalCase React / C# / Classes
—
CONSTANT_CASE ENV / Constants / SQL
—
Sentence case Prose / Microcopy
—
dot.case Properties / Logging
—
lower case Plain text
—
UPPER CASE Emphasis / Headers
—

Syntax & Code Safety Analysis

Case Conversion in Modern Software Development and Publishing

String case conventions define how multi-word identifiers, file paths, database entities, and editorial headlines are structured. In natural language, spaces separate words. In computer programming and digital typography, however, spaces are frequently illegal syntax tokens or sources of runtime ambiguity. Compilers, interpreters, command-line interfaces, URL routers, and database query engines enforce strict conventions for delimiting tokens.

When engineering software across multi-tier stacks—such as a PostgreSQL database, an Express or Django backend, a TypeScript frontend, and a public REST API—developers continually translate identifiers across competing naming styles. A database column named user_first_name in snake_case must be mapped to a JavaScript object property userFirstName in camelCase, serialized into a JSON API key, rendered inside a React component named UserProfile in PascalCase, styled with a CSS class user-profile-card in kebab-case, and deployed to an article slug /user-profile-setup. Manually editing these tokens is slow and prone to typographical errors, accidental acronym mutations, and syntax crashes caused by leading digits or reserved keywords.

Complete Guide to Naming Conventions

Every major software ecosystem and style guide adopts specific case conventions to convey architectural meaning. Recognizing the technical rationale and standard domain for each convention ensures consistency across teams and codebases.

camelCase (Lower Camel Case)

camelCase joins words without spaces, lowercasing the initial letter of the first word and capitalizing the first letter of each subsequent word (for example, getUserAccountBalance or activeSubscriptionCount). camelCase is the undisputed standard for variable declarations, function names, object properties, and method definitions in JavaScript, TypeScript, Java, Kotlin, Swift, and Go. It is also the de facto standard for JSON schema keys.

PascalCase (Upper Camel Case)

PascalCase resembles camelCase, with one critical difference: the first letter of the first word is always capitalized (such as UserProfileComponent or OrderRepository). In object-oriented programming, PascalCase distinguishes types, classes, interfaces, enums, and namespaces from their instantiated variable counterparts. In frontend development with React, Vue, and Angular, PascalCase is mandatory for identifying custom components and differentiating them from native HTML elements.

snake_case (Underscore Case)

snake_case separates words with a lowercase underscore character (for instance, created_at_timestamp or calculate_tax_rate). It is the canonical convention for variable and function names in Python (PEP 8), Ruby, PHP, and Rust, as well as relational database systems including PostgreSQL, MySQL, and SQLite. Because underscores do not conflict with arithmetic subtraction operators in SQL queries, snake_case remains the gold standard for relational database schemas.

kebab-case (Slug Case / Dash Case)

kebab-case connects all-lowercase tokens with hyphens (such as customer-billing-portal or btn-primary-accent). kebab-case is standard across CSS class names, HTML data attributes, URL paths, REST API endpoint routes, package names on npm, and Kubernetes configuration files. Hyphens are human-readable in browser address bars and are indexed as individual word separators by Google search engine algorithms, making kebab-case the primary format for SEO-friendly URL slugs.

CONSTANT_CASE (SCREAMING_SNAKE_CASE)

CONSTANT_CASE writes every character in uppercase, separating words with underscores (for example, MAX_RETRY_ATTEMPTS or DATABASE_URL). This convention signals immutability. Software engineers use CONSTANT_CASE for global application constants, system environment variables, configuration flags, and SQL keywords.

Title Case (AP and Chicago Headline Style)

Title Case capitalizes the primary words in a title, headline, or navigation menu while keeping minor grammatical words lowercase unless they begin or end the title. Under major journalistic and publishing manuals such as the Associated Press (AP) Stylebook and The Chicago Manual of Style, articles (a, an, the), coordinating conjunctions (and, but, for, nor, or), and short prepositions (at, by, in, of, on, to, with) remain lowercase. Furthermore, words immediately following colons or dashes are capitalized to designate formal subtitles.

Sentence case

Sentence case capitalizes only the first letter of the initial word and proper nouns, with all other words lowercased (for example, "Update your account billing preferences"). Modern UX microcopy, mobile application dialogs, SaaS notification banners, and transactional cold email subject lines increasingly favor sentence case because it reads conversationally and avoids the corporate formality of heavy title casing.

dot.case (Dot Notation)

dot.case links lowercase words with periods (such as user.profile.picture.url). It is widely utilized in system logging categories (Log4j, Winston), internationalization keypaths (i18n), package namespace identifiers (Java package paths), and nested configuration schemas.

Comparative Case Conventions Matrix

The following matrix outlines each convention, its token delimiter, representative code example, and predominant technology stack:

Convention Delimiter Example Identifier Primary Stacks & Ecosystems Standard Architectural Role
camelCase None (Capital Letter) userSessionToken JavaScript, TypeScript, Java, Go, Swift Variables, object properties, JSON keys, functions
PascalCase None (Capital Letter) UserSessionToken React, TypeScript, C#, Python Classes Classes, React components, types, interfaces
snake_case Underscore (_) user_session_token Python (PEP 8), PostgreSQL, MySQL, Ruby, Rust Database column names, Python functions, variables
kebab-case Hyphen (-) user-session-token CSS, HTML, REST URLs, SEO slugs, npm URL slugs, CSS classes, package identifiers
CONSTANT_CASE Underscore (_) USER_SESSION_TOKEN Linux, Docker, Node.js ENV, C/C++ Macros Environment variables, global constants, enums
Title Case Space ( ) User Session Token Publishing, Journalism, AP/Chicago Style Article headlines, page titles, navigation menus
Sentence case Space ( ) User session token UI Microcopy, Product Design, SaaS UX Form labels, toast notifications, helper text
dot.case Period (.) user.session.token Logging, i18n, Java Packages, Config keys Property access paths, configuration namespaces

How Tokenization and Case Conversion Work

Case conversion is fundamentally a tokenization and reconstruction pipeline. Many simplistic online tools merely execute basic character replacement or indiscriminate lowercasing, which corrupts acronyms and ruins mixed-format code. A robust converter executes four discrete algorithmic stages:

  1. Punctuation and delimiter isolation: The input string is scanned for explicit boundary characters including spaces, hyphens, underscores, slashes, and periods. Consecutive delimiters (such as __ or --) are collapsed to avoid producing double dividers.
  2. Regex transition detection: Boundary markers inside un-delimited strings are detected by inspecting letter casing transitions. A lowercase letter followed immediately by an uppercase letter ([a-z][A-Z]) marks a word boundary (such as getUser → get User).
  3. Acronym boundary disambiguation: Consecutive capital letters followed by a capital letter and a lowercase letter ([A-Z]+[A-Z][a-z]) represent an acronym boundary (such as parseHTMLToJSON → parse HTML To JSON). Proper heuristic splitting ensures that acronyms like HTML or API are not mangled into single disjointed letters.
  4. Diacritic and accent normalization: Accented letters (such as é, ü, ñ, ø) are normalized using Unicode Normalization Form D (NFD) and stripped of combining diacritical marks. This converts foreign characters into standard ASCII letters (café becomes cafe), preventing compiler encoding failures in programming identifiers.
  5. Target casing formatting: Words are transformed according to the target style's capitalization and delimiter rules, joining the normalized tokens into a cohesive identifier or sentence.

What Client-Side Tokenizers Cannot Infer

While algorithmic regex tokenizers reliably split camelCase, snake_case, and delimited phrases, they cannot guess word boundaries in unseparated, single-case strings. For instance, an input like thisisateststring lacks delimiter markers or casing clues. Without an integrated natural language dictionary lookup, an algorithm cannot know whether atest should be split as "a test" or "at est". For unspaced text, inserting manual spaces or underscores prior to conversion ensures flawless output.

Preventing Identifier Syntax Collisions

Converting a string into a programming variable or database column requires more than visual transformation; it requires adherence to language-specific syntax rules. This tool evaluates converted strings against four common syntax failure modes:

  • Leading digit restrictions: In ECMAScript (JavaScript), Python, Java, C++, PHP, and Go, identifier names cannot begin with a numeric character (0–9). A variable name like 2fast2furious or 100PercentDiscount will cause a runtime SyntaxError: Invalid or unexpected token. Identifiers must begin with an ASCII letter, underscore, or dollar sign.
  • Reserved keyword collisions: Converting natural language into code can inadvertently produce an exact match with a programming language keyword (such as default, class, function, return, delete, or import). Declaring a variable with a bare reserved keyword triggers compiler errors across virtually all modern runtimes.
  • Database column truncation: Relational database engines enforce hard maximum lengths on identifier names. PostgreSQL limits column and table names to 63 bytes (NAMEDATALEN - 1), while MySQL enforces a 64-character ceiling. Converting long phrases into database column names without truncating can result in silent identifier clipping and schema migration bugs.
  • Search engine slug budgets: While URLs can technically span thousands of characters, search engines truncate URL snippets in desktop search results beyond approximately 60 to 75 characters. Keeping kebab-case slugs concise preserves organic search snippet clarity.

Step-by-Step Conversion Workflows

Workflow 1: Converting Relational Schemas to TypeScript Interfaces

When pulling records from a SQL database into a TypeScript service layer, database columns are formatted in snake_case, whereas TypeScript interfaces require camelCase. Pasting your schema column list (for example, user_account_id, billing_cycle_start, is_verified_subscriber) with Line-by-line mode enabled transforms dozens of fields into userAccountId, billingCycleStart, and isVerifiedSubscriber in one step.

Workflow 2: Generating Clean URL Slugs from Editorial Headlines

Publishing articles requires translating descriptive titles into clean, search-optimized slugs. Entering an editorial headline like "Cold Email Outreach: 10 Proven Strategies for 2026" into kebab-case mode strips colons, normalizes minor words, and produces cold-email-outreach-10-proven-strategies-for-2026 ready for your CMS permalink.

Workflow 3: Standardizing Environment Variables into CONSTANT_CASE

Configuration files and container manifests require uppercase, underscore-separated variable names. Converting mixed configuration keys like stripeSecretKey and databaseConnectionTimeoutMs yields STRIPE_SECRET_KEY and DATABASE_CONNECTION_TIMEOUT_MS, preventing inconsistent naming across team members.

Frequently Asked Questions

What is the core difference between camelCase and PascalCase?

Both conventions eliminate spaces and capitalize subsequent words. However, camelCase starts with a lowercase letter (firstName), making it standard for variables, methods, and properties. PascalCase starts with an uppercase letter (FirstName), making it standard for classes, types, interfaces, and React components.

How does the converter handle acronyms like HTML or API?

By default, identifier conversion treats tokens in camelCase or snake_case with normalized casing (for example, parseHtmlToJson or parse_html_to_json). Enabling the Preserve acronyms checkbox retains consecutive uppercase letters in camelCase and PascalCase (yielding parseHTMLToJSON), matching the style guides of projects that mandate uppercase acronyms.

Why are certain words lowercased in Title Case?

Standard editorial style guides—including AP, Chicago, and MLA—stipulate that minor grammatical words (articles, coordinating conjunctions, and short prepositions such as a, an, the, and, but, for, in, on, of, to) should remain lowercase unless they occur as the first or last word of a headline or immediately follow a colon or em-dash.

Can I convert multiple lines of variable names or database columns at once?

Yes. With the Line-by-line option checked (enabled by default), every line of text in the input box is processed independently. This enables you to paste entire database schema definitions, lists of CSS classes, or batches of URL titles and convert them all simultaneously.

Does this tool store or upload my text or code?

No. The conversion logic runs entirely on the client side inside your web browser using vanilla JavaScript. No text, tokens, or identifiers are transmitted to an external server or stored in local browser cookies.

Related Developer & Content Tools

  • Text Diff Checker — Compare code snippets, variable lists, or copy side-by-side with line-by-line highlight diffs.
  • Duplicate Line Remover — Clean bulk data sets and lists by filtering out repeated rows and whitespace.
  • Whitespace Cleaner — Normalize spaces, tabs, and line breaks across raw text or code files.
  • Slug Generator & Optimizer — Generate SEO-friendly URL slugs with stop-word removal and length counters.
  • Cold Email & Outreach Services — Professional copywriting, list cleaning, and deliverability infrastructure for B2B founders and sales teams.