The three project identifiers
GCP projects expose three distinct identifiers: the project name, the project ID, and the project number. Each serves a different purpose.Use the project name for human-readability; use the project ID for resource paths, scripts, and most automations; and be aware that Google services often reference the project number for billing and internal links.
Project IDs and project numbers are immutable. Choose project IDs carefully — once created they cannot be changed.
Identifier details and rules
-
Project name
- Free-text, intended for people. It can contain spaces and punctuation.
- Changeable at any time without affecting resource references.
-
Project ID
- Globally unique across GCP.
- Naming rules: 6–30 characters, lowercase letters (
a–z), digits (0–9), and hyphens (-); must begin with a letter and end with a letter or digit. - Used in resource identifiers such as
projects/{PROJECT_ID}(wrap the placeholder in backticks when documenting).
-
Project number
- A numeric, Google-assigned identifier (e.g.,
123456789012). - Frequently used behind the scenes for billing, quotas, and Google-managed integrations.
- A numeric, Google-assigned identifier (e.g.,
How these identifiers are used
- Resource names and many APIs use the project ID in paths, for example:
projects/{PROJECT_ID} - Some APIs, billing connectors, and quota systems prefer or require the project number. A few APIs accept either the project ID or project number.
- IAM and resource-level permissions often reference the project ID in role bindings and policy documents; internal links and system accounts may use the project number.
Common use-case mapping
Examples and gcloud commands
- Create a new project:
- Retrieve identifiers for a project:
- List projects with key fields:
Best practices
- Adopt a standardized naming convention for project names and project IDs. Typical components include organization, environment (dev/stage/prod), team, and application shorthand.
- Example:
- name: “Acme Analytics — Prod”
- project-id:
acme-analytics-prod
- Example:
- Keep project IDs short, descriptive, and free of sensitive information (avoid embedding passwords, personal data, or secret keys).
- Use the project ID in scripts, IaC (Terraform, Deployment Manager), and CI/CD pipelines because it is stable and globally unique.
- Avoid personal or ephemeral identifiers in a project ID because it cannot be changed later.
When to check API docs
Some APIs accept either theprojectId or projectNumber; others require the numeric project number. If you see an API parameter like parent or name that references a project, consult that API’s documentation to confirm which identifier is accepted. Always prefer the project ID in automation unless the docs explicitly require the project number.
Summary
- GCP projects expose three identifiers: a mutable human-readable name, an immutable globally unique project ID (string), and an immutable numeric project number.
- Use the project name for display, the project ID for scripts and resource paths, and be aware that Google services sometimes require the project number.
- Follow consistent naming conventions and avoid embedding sensitive information in project IDs.