Utilcrate logo

Text Case Formats Every Developer Should Know

A quick reference guide to camelCase, snake_case, kebab-case, PascalCase, and more—with examples of when to use each one.

text formatting
developer
naming conventions
programming

Published on March 1, 2025

Choosing the right text case format is more than a style preference. It is a convention that helps teams write consistent, readable, and maintainable code. Here is a complete guide to the most common case formats and where to use them.

camelCase

The first word is lowercase; each subsequent word starts with a capital letter. No spaces or separators.

const userProfile = getUserProfile();

Best for: JavaScript variables, function names, object properties, JSON keys.

PascalCase

Every word starts with a capital letter. No spaces or separators.

class UserProfile {}

Best for: Class names, React components, TypeScript interfaces, enum names.

snake_case

All lowercase with underscores separating words.

user_profile = get_user_profile()

Best for: Python variables, database columns, file names, API endpoints.

kebab-case

All lowercase with hyphens separating words.

<div class="user-profile-card"></div>

Best for: CSS class names, HTML attributes, URL slugs, file names.

CONSTANT_CASE (SCREAMING_SNAKE_CASE)

All uppercase with underscores separating words.

const API_BASE_URL = "https://api.example.com";

Best for: Environment variables, global constants, configuration keys.

Quick Reference Table

FormatExampleCommon Use
camelCaseuserProfileJS variables, functions
PascalCaseUserProfileClasses, components
snake_caseuser_profilePython, databases
kebab-caseuser-profileCSS, URLs
CONSTANT_CASEUSER_PROFILEConstants, env vars

Convert Between Cases Instantly

Need to refactor a codebase with inconsistent naming? Use our free text case converter to transform text between any format in seconds.

Other Articles You Might Like

Text Case Formats Every Developer Should Know | UtilCrate