Salesforce Dictionary - Free Salesforce GlossarySalesforce Dictionary
Setup & Metadata

Salesforce Label to API Name Converter

Turn a human-readable field or object label into the API name Salesforce would generate, plus the custom (__c) suffix and PascalCase / snake_case variants.

Label

Custom suffix

API names

Output appears here.

Related dictionary terms

§

About this tool

When you create a field or object in Setup, Salesforce auto-generates the API name from the label by replacing spaces and punctuation with underscores, collapsing repeats, and trimming the ends. Guessing that name by hand before the metadata exists is fiddly, especially when you are writing the SOQL, Apex, or flow that references it. Type a label and this tool shows the exact API name Salesforce would produce, alongside the custom (__c) form and PascalCase / snake_case variants for code.

How it works

The tool trims the label, replaces every run of non-alphanumeric characters with a single underscore, strips leading and trailing underscores, and prefixes an X if the result would start with a digit (API names cannot begin with a number). That gives the base API name. The custom field/object variant appends the __c suffix. PascalCase strips the separators and capitalises each word for Apex class-style naming, and snake_case lowercases the words joined by underscores. Everything is derived locally from the text you type, live on each keystroke.

When to use it
  • Writing SOQL or Apex against a custom field before the field exists in the org, so the reference is correct the first time.
  • Keeping field naming consistent across a team by pasting the proposed label and using the generated API name verbatim.
  • Generating PascalCase or snake_case identifiers from a business label for an integration mapping or a code variable.
§

Frequently asked questions

Will this always match the name Salesforce generates?
For the common cases (letters, numbers, spaces, and punctuation) it follows Salesforce's rules: non-alphanumeric runs become a single underscore, the ends are trimmed, and a leading digit gets an X prefix. Very unusual labels (heavy Unicode, reserved words) can still differ, so confirm against Setup for edge cases.
What is the __c suffix for?
Every custom field and custom object in Salesforce ends in __c. The converter shows that form so you can paste the complete API name a custom component expects, not just the base.
Does it handle namespaced fields?
It generates the unmanaged API name. If your org is in a managed package, prepend the package namespace (namespace__Field__c) yourself, since the namespace is not derivable from the label.