NOTACAL logo

Case Converter

Case Converter

Give us your feedback! Was this useful?

Introduction

Naming conventions are one of the most debated topics in software engineering. Every programming language, framework, and community has developed its own set of conventions for how variables, functions, classes, and constants should be named. These conventions — collectively known as "case formats" — dictate whether a name like userLoginCount should be written in camelCase, snake_case, PascalCase, or any of a dozen other variations. While this diversity reflects the rich ecosystem of programming languages, it also creates a constant need for conversion: a Python developer consuming a JavaScript API must mentally translate camelCase properties to snake_case variables, and a database administrator defining SQL column names faces completely different conventions from those used in the application code.

A case converter eliminates this friction. Instead of manually retyping or mentally translating each identifier, you can paste any text and instantly see it transformed into every major casing format. This is invaluable for developers working across language boundaries, technical writers producing documentation for multi-language codebases, and DevOps engineers juggling configuration files that use different conventions for the same logical entity.

The nine formats covered by this tool represent the vast majority of naming conventions encountered in modern software development. From the camelCase ubiquitous in JavaScript and Java to the CONSTANT_CASE used for environment variables and configuration keys, each format has a specific purpose, history, and set of rules. Understanding when and why to use each one is a skill that separates novice developers from experienced engineers who can seamlessly navigate projects written in different languages.

How to Use

Using the Case Converter is straightforward. Type or paste any text into the input area, and all nine case conversions appear instantly. The tool processes your input on every keystroke with auto-calculation enabled, so there is no button to press and no delay.

Example 1 — Converting a multi-word variable name

Consider the English phrase "user login count". As you type it into the input, the output panel shows all nine formats:

FormatOutput
camelCaseuserLoginCount
PascalCaseUserLoginCount
snake_caseuser_login_count
kebab-caseuser-login-count
CONSTANT_CASEUSER_LOGIN_COUNT
Title CaseUser Login Count
dot.caseuser.login.count
path/caseuser/login/count
lowercaseuser login count

This single example illustrates the core difference between the formats: the separator character (or lack thereof) and the capitalization strategy.

Example 2 — Converting a camelCase identifier

Suppose you are working with a TypeScript API that returns lastLoginTimestamp and you need to define a corresponding column in a PostgreSQL database, which conventionally uses snake_case. Paste lastLoginTimestamp into the input:

FormatOutput
camelCaselastLoginTimestamp
snake_caselast_login_timestamp
CONSTANT_CASELAST_LOGIN_TIMESTAMP
lowercaselast login timestamp

The tool correctly identifies the word boundaries by detecting the capital letters within the camelCase text. This is one of the most common use cases for the tool: converting between API response property names (often camelCase or PascalCase) and database column names (typically snake_case).

Example 3 — Converting CONSTANT_CASE to other formats

Environment variables, configuration keys, and constants in compiled languages typically use CONSTANT_CASE. Paste MAX_CONNECTION_RETRIES into the input:

FormatOutput
camelCasemaxConnectionRetries
PascalCaseMaxConnectionRetries
kebab-casemax-connection-retries
dot.casemax.connection.retries

Edge Cases

  • Empty input: When the input is empty, no results are displayed. The tool waits for you to type something.
  • Single word: A single word like hello produces identical output across most formats: hello, Hello, HELLO. camelCase and PascalCase differ (hello vs Hello).
  • Numbers in text: Numbers are treated as part of the word they are attached to. user2name becomes user2name in camelCase and User2name in PascalCase. If numbers are separated, like version 2 final, they are treated as separate words: version2Final.
  • Mixed separators: The tool handles any combination of spaces, hyphens, underscores, dots, slashes, and camelCase boundaries in a single input. For example, user_name API-key splits into user, name, api, key.
  • Non-ASCII characters: Characters like accented letters (é, ü, ñ) pass through unchanged. The tool does not attempt to transliterate or remove diacritics.

Case Format Reference

Understanding the rules and conventions of each case format is essential for using the right one in the right context.

camelCase

Each word after the first starts with a capital letter, with no separators. The first word is all lowercase. Also known as lowerCamelCase or dromedary case. Originates from the practice of "humping" the first letter of each word.

  • Example: userLoginCount
  • Used in: JavaScript, TypeScript, Java (variables and methods), Swift (variables and properties), Go (unexported identifiers)
  • Key rule: The first letter is always lowercase.

PascalCase

Every word starts with a capital letter, with no separators. Also known as UpperCamelCase.

  • Example: UserLoginCount
  • Used in: C# (classes, methods, properties), TypeScript (classes, interfaces, types), Java (classes), Python (classes), React components
  • Key rule: The first letter is always uppercase. All words are capitalized.

snake_case

All words are lowercase and separated by underscores. Also known as pothole_case or underscore_case.

  • Example: user_login_count
  • Used in: Python (variables, functions, modules), Ruby (identifiers), Rust (variable names), C (standard library functions), PostgreSQL (columns and tables), JSON field names in some APIs
  • Key rule: Words are separated by underscores, all lowercase. Some variations use SCREAMING_SNAKE_CASE for constants.

kebab-case

All words are lowercase and separated by hyphens. Also known as spinal-case, dash-case, or Lisp-case.

  • Example: user-login-count
  • Used in: URL slugs (/user-login-count), HTML/CSS class names and IDs, Lisp and Clojure identifiers, npm package names, file names
  • Key rule: Hyphens separate words. Not valid in most programming languages because the hyphen is interpreted as a minus operator.

CONSTANT_CASE

All words are uppercase and separated by underscores. Also known as SCREAMING_SNAKE_CASE or UPPER_CASE.

  • Example: USER_LOGIN_COUNT
  • Used in: C/C++ preprocessor macros, environment variables (e.g., NODE_ENV), configuration keys, Python and Rust constants, Java static final fields
  • Key rule: Every character is uppercase. Words separated by underscores.

Title Case

Every word starts with a capital letter, separated by spaces.

  • Example: User Login Count
  • Used in: Human-readable headings, UI labels, documentation, MLA/APA titles
  • Key rule: Each word is capitalized. Not a programming convention — used for display purposes.

dot.case

All words are lowercase and separated by periods (dots).

  • Example: user.login.count
  • Used in: Java package names (com.example.app), JavaScript object paths, some configuration key hierarchies
  • Key rule: Periods separate words. All lowercase.

path/case

All words are lowercase and separated by forward slashes.

  • Example: user/login/count
  • Used in: File system paths, URL path segments, some structured configuration keys
  • Key rule: Forward slashes separate words. All lowercase.

lowercase

All words are lowercase and separated by spaces.

  • Example: user login count
  • Used in: Natural language text, search queries, display text
  • Key rule: Simple lowercase with space separation. No programming use.

Reference Table

Naming Conventions by Programming Language

LanguageVariablesFunctionsClassesConstantsFiles
JavaScriptcamelCasecamelCasePascalCaseCONSTANT_CASEkebab-case
TypeScriptcamelCasecamelCasePascalCaseCONSTANT_CASEkebab-case
Pythonsnake_casesnake_casePascalCaseCONSTANT_CASEsnake_case
JavacamelCasecamelCasePascalCaseCONSTANT_CASEPascalCase
C#camelCasePascalCasePascalCasePascalCasePascalCase
Rubysnake_casesnake_casePascalCaseCONSTANT_CASEsnake_case
Rustsnake_casesnake_casePascalCaseCONSTANT_CASEsnake_case
GocamelCasecamelCasePascalCasesnake_case
SQL (PostgreSQL)snake_casesnake_casesnake_case
PHPcamelCasecamelCasePascalCaseCONSTANT_CASEsnake_case

Common Naming Convention Patterns by Ecosystem

EcosystemProperty NamesType/Class NamesConstant NamesFile Names
React/Next.jscamelCasePascalCaseCONSTANT_CASEkebab-case
AngularcamelCasePascalCaseCONSTANT_CASEkebab-case
Djangosnake_casePascalCaseCONSTANT_CASEsnake_case
Railssnake_casePascalCaseCONSTANT_CASEsnake_case
Spring BootcamelCasePascalCaseCONSTANT_CASEkebab-case
Node.js packagescamelCasePascalCaseCONSTANT_CASEkebab-case
Kubernetes configscamelCasePascalCaseCONSTANT_CASE
Terraformsnake_casePascalCaseCONSTANT_CASEsnake_case

Format Characteristics Comparison

FormatSeparatorCaseReadabilityLanguage SupportURL-Safe
camelCaseNonelowercase, then capsMediumSupported nativelyYes
PascalCaseNoneCapitalizedHighSupported nativelyYes
snake_caseUnderscoreLowercaseHighSupported nativelyYes
kebab-caseHyphenLowercaseVery HighNot as identifiersYes
CONSTANT_CASEUnderscoreUppercaseMediumSupportedYes
Title CaseSpaceCapitalizedVery HighNot as identifiersNo
dot.casePeriodLowercaseMediumPartial (Java packages)Yes
path/caseSlashLowercaseHighNot as identifiersYes (URLs)
lowercaseSpaceLowercaseHighNot as identifiersNo

Practical Tips

1. Follow language-specific style guides consistently. The most important rule in naming conventions is not which format you choose, but how consistently you apply it. Google's TypeScript style guide mandates camelCase for all identifiers except classes, which use PascalCase. Python's PEP 8 requires snake_case for functions and variables. Mixing conventions within a single codebase creates cognitive friction for every developer who reads it. Lint rules in ESLint (for JavaScript/TypeScript), Pylint (for Python), and RuboCop (for Ruby) can enforce these conventions automatically.

2. Use CONSTANT_CASE for environment variables and configuration keys. Environment variables are conventionally written in CONSTANT_CASE across all platforms and languages: NODE_ENV, DATABASE_URL, API_KEY. This visual distinction makes them immediately recognizable in code. The same convention applies to build-time constants, magic numbers, and any value that should not change during program execution.

3. Database naming conventions differ from application conventions. SQL databases conventionally use snake_case for table and column names (e.g., user_login_count), while most application code uses camelCase. ORMs like Sequelize, Prisma, and SQLAlchemy provide automatic conversion between the two. If you are designing a database schema, prefer snake_case for portability across SQL dialects and tooling compatibility.

4. Use kebab-case for URLs and file names. URLs naturally use hyphens because they are more readable than underscores in browser address bars and are treated as word separators by search engines for SEO purposes. Similarly, kebab-case is the conventional format for file names in most web development frameworks — React components in Next.js live in files like user-login-form.tsx, and Vue components follow the same pattern.

5. PascalCase is mandatory for React components and TypeScript types. In JSX, React treats lowercase tag names as HTML elements and capitalized names as custom components. Using PascalCase for component names (e.g., UserLoginForm) is not optional — it is a hard requirement enforced by the JSX compiler. The same convention applies to TypeScript interfaces and type aliases, making them visually distinct from regular variables.

6. Be careful with abbreviations and acronyms. In camelCase and PascalCase, a common point of confusion is how to handle abbreviations. Should parseJSON be written as parseJSON, parseJson, or parse_JSON? Most style guides recommend treating the abbreviation as a normal word: parseJson, HtmlParser, loadXmlDocument. Microsoft's .NET naming guidelines specifically recommend PascalCase for two-letter acronyms (IOStream) and normal casing for longer ones (HtmlParser).

Limitations

While the Case Converter handles a wide range of input formats, there are important limitations to understand. First, abbreviation and acronym handling is not configurable. The tool treats each detected word unit as a single entity for capitalization purposes. If you input parseHTML, the tool splits it into ["parse", "h", "t", "m", "l"] because each uppercase letter in a contiguous block of capitals is treated as a separate word boundary. This produces parseHtml when you might expect parseHTML. The correct behavior depends on your style guide, and no automated tool can perfectly resolve this ambiguity without context.

Second, acronym ambiguity in CONSTANT_CASE can produce unexpected results. For example, XMLParser becomes xml_parser in snake_case (lowercasing everything) and XmlParser in PascalCase. If your intention was to preserve XML as an acronym, the tool cannot know this.

Third, non-ASCII characters and Unicode normalization are preserved literally. Input containing accented characters (é, ü, ñ), non-Latin scripts (Cyrillic, CJK), or emoji are passed through without modification. The tool does not transliterate or remove diacritics. For identifiers in programming languages that only support ASCII, you may need to manually transliterate these characters.

Fourth, number handling is simplistic. The tool treats digits as part of the adjacent word. version2 remains version2 in all formats. If you need version2 to become version_two or version-2, you must insert a separator before the digit.

Fifth, the tool does not validate whether the output is a valid identifier in any particular language. For example, kebab-case output is not a valid JavaScript identifier (because hyphens are minus operators), but the tool still produces it. Similarly, some outputs may conflict with reserved keywords in certain languages. Validation is the responsibility of the developer.

Frequently Asked Questions

When should I use camelCase vs snake_case?
This depends entirely on your programming language and project conventions. camelCase is standard in JavaScript, TypeScript, Java, and Go. snake_case is standard in Python, Ruby, and Rust. The most important rule is consistency: follow the dominant convention of the language you are using. Trying to use snake_case in a JavaScript codebase that uses camelCase everywhere will be confusing for other developers.
How do you convert between camelCase and snake_case?
The conversion process has two steps: splitting and rejoining. To convert camelCase to snake_case, detect each capital letter as a word boundary, split the identifier into lowercase words, and rejoin them with underscores. To go the other direction, split on underscores, capitalize each word after the first, and remove the separators. This tool performs both conversions automatically.
Does TypeScript prefer camelCase or PascalCase for interfaces?
According to the official TypeScript style guide and Microsoft's coding conventions, interfaces should use PascalCase (e.g., `UserData`). However, some older codebases prefix interfaces with a capital I (e.g., `IUserData`), though this Hungarian notation style has fallen out of favor. TypeScript's `interface` and `type` declarations both conventionally use PascalCase, distinguishing them from regular variables and functions.
What naming convention should I use for database column names?
PostgreSQL and most SQL databases conventionally use snake_case for table and column names (e.g., `user_login_count`, `created_at`). MySQL is more flexible but snake_case is still the most common. Some teams use camelCase for column names to match their application code, but this requires quoting in SQL (because PostgreSQL lowercases unquoted identifiers) and is generally discouraged for portability.
Why are there so many different case formats?
Different case formats evolved because different programming languages and environments have different syntactic constraints. C could not use hyphens (they are minus operators), so underscores became the separator in snake_case. Java and JavaScript favored camelCase because it was more compact. Lisp needed hyphens because its macro system treated underscores as part of identifiers. URLs prefer hyphens because they are more readable and SEO-friendly. Each format was a practical solution to a specific constraint.
Can I use kebab-case for variable names in JavaScript?
No. JavaScript identifiers cannot contain hyphens because the hyphen-minus character is interpreted as the subtraction operator. `user-login-count` in JavaScript is parsed as `user - login - count`, which is an arithmetic expression. If you are writing JavaScript or TypeScript, use camelCase for variables and PascalCase for classes.
What is the naming convention for environment variables?
Environment variables universally use CONSTANT_CASE: all uppercase letters with underscores as word separators. Examples include `NODE_ENV`, `DATABASE_URL`, `PORT`, `API_KEY`, and `STRIPE_SECRET_KEY`. This convention is followed across all operating systems (Linux, macOS, Windows), all programming languages, and all hosting platforms (Heroku, Vercel, AWS, Netlify).
How do Python and JavaScript naming conventions differ?
Python (PEP 8) uses snake_case for functions, variables, and modules, while JavaScript uses camelCase for the same constructs. Python uses PascalCase for classes, and JavaScript does the same. Python constants are CONSTANT_CASE, while JavaScript constants are typically camelCase (unless they are truly immutable primitives). Python module file names use snake_case, while JavaScript/TypeScript files use kebab-case.
What naming convention should I use for URL slugs?
URL slugs should always use kebab-case (lowercase with hyphens). This is because search engines treat hyphens as word separators, improving SEO, while underscores are treated as word joiners. Kebab-case slugs are also the most readable for users. For example, `/my-blog-post` is much clearer than `/my_blog_post` or `/myBlogPost`.
Should I use Hungarian notation?
Hungarian notation (prefixing variable names with their type, like `strName` or `intCount`) is widely considered outdated and unnecessary in modern statically-typed languages. TypeScript, Java, C#, and Rust all have powerful type systems that make type prefixes redundant. The notable exception is React's `use` prefix for hooks (e.g., `useState`), which is a convention baked into the framework and enforced by lint rules.
How should I name React component files?
React component files should use PascalCase to match the component name (e.g., `UserLoginForm.tsx`) or kebab-case (e.g., `user-login-form.tsx`) depending on the project convention. Next.js projects conventionally use kebab-case for page files and PascalCase for component files. The file extension should be `.tsx` (or `.jsx` for JavaScript) to enable JSX syntax.
What is the safest naming convention for cross-language projects?
snake_case is the most portable naming convention across different programming languages. It is valid in Python, Ruby, Rust, C, C++, PHP, Perl, R, and many others. It does not conflict with any operator symbols. It is the recommended convention for data exchange schemas, API contracts, and database schemas that must be consumed by multiple languages.

Last updated: June 15, 2026

UB

UnByte — Independent Software Engineering

Every calculator references authoritative sources — Editorial policy