Guide2026-11-089 min read

Naming Conventions: What They Are, Common Styles and Examples

A naming convention is an agreed set of rules for how things are named: which words go in a name, in what order, how the words are separated, and which characters are allowed. It applies to anything that gets a name, such as files, folders, variables, database tables, servers or cloud resources. The point is that anyone (including you, a year from now) can guess what something is called, find it, and sort it, without opening it.

A full naming convention usually answers four questions:

  1. What goes in the name: for example date, project, subject, version.
  2. In what order: the most useful sort key goes first.
  3. How words are separated: spaces, hyphens, underscores or capital letters.
  4. What is not allowed: spaces, special characters, abbreviations nobody else understands, names longer than a set limit.

This guide explains the common naming styles (camelCase, snake_case, kebab-case and the rest), shows example conventions for files, folders, code and cloud resources, and ends with how to choose one and actually make it stick. If you only care about documents and photos on your computer, the file naming conventions guide goes deeper on that.

What "naming convention" means

The word convention is the key part. A naming convention is not a technical rule that a system enforces; it is an agreement between people. Windows will happily let you save Final FINAL v2 (copy).docx, and Python will run code with a variable called x2. The convention is what a team, or a single person, decides on top of what the system allows, so that names are predictable.

That predictability pays off in three ways:

  • Finding things: if every invoice starts with invoice- and the client name, you can search for it instead of browsing.
  • Sorting: names that start with 2026-11-08 line up in date order in every file manager and every ls listing.
  • Avoiding breakage: names without spaces or special characters work in URLs, command lines, scripts and every operating system.

Common naming styles (case conventions)

Most naming conventions start by choosing how to join words, because almost every system has trouble with spaces somewhere. These are the styles you will meet most often:

StyleExampleTypically used for
camelCaseinvoiceTotalVariables and functions in JavaScript, Java, C#
PascalCaseInvoiceTotalClasses and types in most languages, React components, C# methods
snake_caseinvoice_totalVariables and functions in Python and Ruby, database columns
SCREAMING_SNAKE_CASEINVOICE_TOTALConstants and environment variables
kebab-caseinvoice-totalURLs, CSS classes, file names, cloud resource names
Train-CaseInvoice-TotalHTTP headers such as Content-Type
lowercaseinvoicetotalPython package names, some domains

A few details that trip people up:

  • camelCase is sometimes called lower camel case, and PascalCase upper camel case. They differ only in the first letter.
  • Acronyms need a rule. Is it parseHtml or parseHTML, UserId or UserID? Either is fine; mixing them is not. Many style guides (Google's Java style guide, for example) treat acronyms as words: parseHtml.
  • kebab-case cannot be used for variable names in most programming languages, because the hyphen is the minus operator. That is why code uses camelCase or snake_case and URLs use kebab-case.

Dates in names: use ISO 8601

If a name contains a date, write it as year-month-day with leading zeros: 2026-11-08. This is the ISO 8601 format, and it has one big advantage over every other format: alphabetical order is the same as chronological order. 2026-02-01 sorts before 2026-11-08 in any file manager, while 1-2-2026 and 11-8-2026 sort by the first digit and land in the wrong order.

It also removes the US/European ambiguity. Is 03-04-2026 March 4 or April 3? 2026-03-04 can only be read one way.

For times, add T or an underscore and use the 24-hour clock: 2026-11-08_1430. Avoid colons, which Windows does not allow in file names and macOS Finder does not allow either.

Naming convention examples

The same principles apply everywhere, but each area has its own habits. These examples are starting points to adapt, not standards you must follow.

Files

A good file name says what the file is without opening it. A common pattern is date, then subject, then version:

2026-11-08_acme_invoice_0142.pdf
2026-11-08_board-meeting_minutes_v2.docx
lisbon-trip_2026-07_001.jpg

Here underscores separate the parts of the pattern and hyphens join words within a part. That is a deliberate convention: you can split the name on _ to get its fields back. Detailed patterns for documents, photos and versions are in the file naming conventions guide, and the video file naming conventions post covers footage and edits.

Folders

Folder names set the top-level sort, so lead with whatever you browse by. For client work, that is usually the client or project; for archives, the year:

clients/
  acme/
    2026-01_website-redesign/
    2026-09_brand-refresh/
archive/
  2024/
  2025/

A number prefix forces a custom order in any file manager: 01_inbox, 02_active, 03_done, 99_archive. Keep folder names short, because the full path is what hits length limits (Windows still has a classic 260-character path limit in many apps).

Code

Programming languages mostly have official or widely accepted conventions, so the job is to follow them rather than invent one:

  • Python (PEP 8): snake_case for functions and variables, PascalCase for classes, SCREAMING_SNAKE_CASE for constants, short lowercase module names.
  • JavaScript and TypeScript: camelCase for variables and functions, PascalCase for classes and React components, SCREAMING_SNAKE_CASE for true constants.
  • Java and C#: PascalCase classes; Java methods are camelCase, C# methods are PascalCase.
  • SQL databases: snake_case table and column names are the most common choice, because unquoted identifiers are case-insensitive in many databases.
  • Git branches: a type prefix and kebab-case, such as feat/export-csv or fix/login-timeout.

Beyond case, good code names are specific (unpaidInvoices, not list2), use positive booleans (isVisible, not notHidden), and use verbs for functions (sendReminder()).

Cloud resources and infrastructure

Cloud resource names show up in bills, logs and dashboards, so they usually encode the environment, the application and the resource type. A typical pattern is:

<project>-<environment>-<region>-<resource>
acme-prod-useast1-db
acme-staging-useast1-api
acme-dev-euwest1-logs-bucket

Use lowercase and hyphens: many services restrict names to lowercase letters, numbers and hyphens (Amazon S3 bucket names, for example, must be lowercase), so a lowercase kebab-case convention works almost everywhere. Keep the most variable part at the end so related resources sort together. Microsoft's Cloud Adoption Framework publishes a recommended naming pattern with resource-type abbreviations if you want a ready-made one for Azure.

Servers and devices

For machines, name by role and location rather than by person or theme: web-01, web-02, nyc-printer-3f. Cute themes (planets, cartoon characters) are fun until you have more machines than planets.

How to choose a naming convention

  1. Start from how people look for things. If people search by client, the client goes first. If they search by date, the date does.
  2. Follow existing standards where they exist. For code, use the language's style guide. For URLs, use lowercase kebab-case; Google recommends hyphens rather than underscores to separate words in URLs.
  3. Pick one separator per job. For example, hyphens inside a part and underscores between parts, or hyphens everywhere. Never spaces in anything that might end up in a URL, a script or a terminal (see spaces in file names).
  4. Decide case once. All lowercase is the safest for files and cloud names, because some systems are case-sensitive and some are not.
  5. Define abbreviations. If inv means invoice and prod means production, write it down.
  6. Set a length limit. Long enough to be descriptive, short enough to read in a file list: around 30 to 60 characters works for most file names.
  7. Write two or three real examples. A pattern like <date>_<client>_<type> is easy to misread; 2026-11-08_acme_invoice.pdf is not.

How to enforce a naming convention

A convention nobody follows is just a document. A few ways to make it stick:

  • Put it where people work: a pinned note in the shared drive, a CONTRIBUTING.md in a code repository, a README at the top of a project folder.
  • Use linters for code: ESLint, Pylint and similar tools can flag names that break the language's convention, and CI can block them.
  • Use policies for cloud: Azure Policy and AWS tag policies can require names or tags to follow a pattern.
  • Use templates: saved export presets in Lightroom, document templates, or scan settings that name files at creation time.
  • Fix the backlog in bulk: rename existing files once so new and old match. A rule-based tool such as our free online bulk renamer can convert names to kebab-case or snake_case, replace spaces and add dates. When names need to describe what is inside each file, File Renamer AI reads the content of photos, PDFs and documents and suggests names you can fit to your pattern.

Frequently Asked Questions

What is a naming convention?

A naming convention is an agreed set of rules for naming things such as files, folders, variables or servers. It defines what information goes in a name, in what order, how words are separated and which characters are allowed, so names are predictable, searchable and sort correctly.

What are the most common naming conventions?

The most common case styles are camelCase (invoiceTotal), PascalCase (InvoiceTotal), snake_case (invoice_total), SCREAMING_SNAKE_CASE (INVOICE_TOTAL) and kebab-case (invoice-total). Many conventions also put dates in ISO 8601 format (2026-11-08) so names sort chronologically.

What is the difference between camelCase and PascalCase?

Both join words with capital letters and no separator. camelCase starts with a lowercase letter (orderTotal) and PascalCase starts with a capital (OrderTotal). In most languages camelCase is used for variables and functions and PascalCase for classes and types.

Should I use hyphens or underscores in names?

For URLs and file names that might go on the web, use hyphens: Google recommends hyphens to separate words in URLs. In code, use whatever the language expects, usually underscores (Python) or camelCase (JavaScript), because a hyphen means minus in most programming languages.

What is a good naming convention for files?

Use lowercase, hyphens or underscores instead of spaces, ISO dates (YYYY-MM-DD) at the start when order matters, and a clear subject, for example 2026-11-08_acme_invoice_0142.pdf. Keep version numbers (v1, v2) instead of words like final.

Why are naming conventions important?

They make things easy to find, keep lists sorted in a meaningful order, prevent errors in URLs, scripts and different operating systems, and let a team understand each other's work without asking what a file or variable is.

Ready to organize your files?

Try AI renaming right away. No sign-up needed until you download.

Try It Free