15 vs 18 Digit Salesforce ID [Difference Between Record Ids]

To convert a 15 to 18 digit Salesforce ID, create a formula field on the object with the formula CASESAFEID(Id). The difference between a 15 and 18 digit record ID is only a three-character suffix, and this formula returns the 18-character version for every record, so you can reuse the field in reports, exports and list views.

The 15 to 18 digit Salesforce ID conversion matters because the two formats are not the same string. The 15-digit ID is case-sensitive, so 001D000000IqhSL and 001d000000iqhsl point to different records. The 18-digit ID adds three characters that make it safe to compare in tools that ignore case, such as Excel.

In this tutorial, I will explain the difference between the two formats, then show every way to convert them: a formula field, Apex, Excel and Google Sheets, plus the checksum behind the extra three characters. We will also cover going back from 18 to 15 digits, the org ID, and the report and Data Loader pitfalls that trip people up.