In Salesforce, record IDs can be either 15 characters (case-sensitive) or 18 characters (case-safe). Converting a 15-character ID to an 18-character ID is useful when updating records in external systems that are not case-sensitive, or when working with tools like Data Loader or the Weekly Data Export service. API versions after 2.5 use the 18-character format exclusively. Reports query the database directly and return a 15-character ID.
There are two ways to convert a 15-character Salesforce record ID to an 18-character case-safe ID: creating a CASESAFEID formula field on the object, or using a JavaScript bookmarklet in your browser for on-demand conversions.
This option creates a permanent formula field on an object that always displays the 18-character ID for every record. This is the recommended approach for ongoing use.
Note: When dealing with record types, only custom record types have IDs. Please review Set Record Type Preferences for more information.
This option uses a JavaScript bookmarklet saved in your browser to convert any 15-character Salesforce ID to an 18-character ID on demand — without needing to create a formula field. This is useful for one-off conversions.
[IMAGE GOES HERE — alt: "Browser bookmark creation dialog showing the JavaScript bookmarklet code pasted into the URL field of a new bookmark named Salesforce ID Converter"]
The following JavaScript code prompts you to enter a 15-character Salesforce ID and returns the corresponding 18-character case-safe ID. Paste the entire block into the bookmark URL field:
javascript:(function(){
var input=prompt('Enter 15-character ID');
var output;
if(input.length == 15){
var addon="";
for(var block=0;block<3; block++)
{
var loop=0;
for(var position=0;position<5;position++){
var current=input.charAt(block*5+position);
if(current>="A" && current<="Z")
loop+=1<<position;
}
addon+="ABCDEFGHIJKLMNOPQRSTUVWXYZ012345".charAt(loop);
}
output=(input+addon);
}
else{
alert("Error : "+input+" isn't 15 characters ("+input.length+")");
return;
}
prompt('18-character ID:',output);
})();
Note: This bookmarklet may not work in the Microsoft Edge browser.
How-to Video: How to Convert a 15-Character Id to an 18-Character Id
000385066

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.