Let’s say we have a custom object “Customer__c”, and we want the Key Prefix of this object.
Using Apex:
String keyPrefix result = Customer__c.SObjectType.getDescribe().getKeyPrefix(); System.Debug('Key Prefix: ' + keyPrefix);
Using Workbench:
Login to Workbench || Info || Standard & Custom Objects || Select one object from the picklist || Expand Attributes