Salesforce Dictionary - Free Salesforce GlossarySalesforce Dictionary
IDs & naming

Label → API Name Converter

Turn a field or object label into a clean Salesforce API name. Get PascalCase, snake_case, and the auto-derived API name with the `__c` suffix.

Label

Custom suffix

API names

Output appears here.

Related dictionary terms

§

About this tool

When you create a custom field or object in Salesforce, the API name is auto-derived from the label by replacing whitespace with underscores, stripping non-ASCII, and appending the `__c` suffix. This converter mirrors that behaviour locally so you can plan a naming convention, audit existing fields, or generate the API name for a metadata YAML before you log into Setup.

How it works

The converter trims the label, strips Salesforce-reserved leading characters, replaces runs of whitespace and punctuation with single underscores, and truncates to the 40-character API limit. It then exposes three views of the same name: the auto-derived custom-field form (`Account_Tier__c`), a clean PascalCase variant useful for naming Apex classes (`AccountTier`), and a snake_case form useful in metadata YAML and external integrations (`account_tier`).

When to use it
  • Drafting a naming convention for a new project before any fields exist in the org.
  • Pre-checking that a field label will produce the API name you expect (e.g. "% Discount" yields a different result than you might guess).
  • Generating Apex variable names that mirror the field they wrap, without copy-pasting from Setup.
  • Building metadata YAML or scripted deployments where you need the API name from a human-readable label.
§

Frequently asked questions

Does this tool include the __c suffix automatically?
Yes for the "custom field" output. The PascalCase and snake_case variants omit it because they're typically used for code identifiers and integrations rather than the field itself.
How does Salesforce handle non-ASCII characters in labels?
It strips them. The converter mirrors that, so a label like "Größe" produces "Gre" rather than a longer name.
What is the maximum API-name length?
40 characters for fields and objects. The converter truncates and warns if your label produces a name longer than that.