How to use the Salesforce ID Converter
- Paste one Salesforce ID, or a whole column of IDs, into the input. Separate IDs with new lines, commas or spaces.
- Read the result. It updates as you type and shows the 18-character and 15-character form of every ID.
- Copy a single ID, copy the full list of 18-character IDs, or download the results as a CSV file.
Why Salesforce IDs come in two lengths
A Salesforce record ID is case-sensitive in its 15-character form: 001A0000006Vm9r and 001a0000006vm9r identify different records. Many tools, including spreadsheets and some databases, compare text without regard to case, which makes distinct IDs look identical. The 18-character form solves this by adding three characters that record which letters are uppercase. It is safe to use anywhere.
How the 15 to 18 character conversion works
- Split the 15 characters into three groups of five.
- For each group, note which positions hold an uppercase letter.
- Treat those positions as a 5-bit number, with the first character as the lowest bit.
- Map the number (0 to 31) to one character of
ABCDEFGHIJKLMNOPQRSTUVWXYZ012345. - Append the three characters to the ID.
For 001A0000006Vm9r, the groups 001A0, 00000 and 6Vm9r give 8, 0 and 2, which map to I, A and C. The 18-character ID is 001A0000006Vm9rIAC. Enter a single ID above to see this breakdown for your own ID.
When you need 18 characters
- Matching records in Excel or Google Sheets with
VLOOKUP,XLOOKUPorMATCH. - Loading data with tools that compare IDs case-insensitively.
- Storing Salesforce IDs in an external database or data warehouse.
- Comparing an ID from a report or URL (often 15 characters) with one from the API (always 18).
Example
Input (15) 001A0000006Vm9r
Output (18) 001A0000006Vm9rIAC
Input (18, casing lost) 001A0000006VM9RIAC
Restored 001A0000006Vm9rIACGetting 18-character IDs inside Salesforce
In a formula field, CASESAFEID(Id) returns the 18-character ID, which is useful in reports. In Apex, an Id value converted with String.valueOf is 18 characters long. Data Loader and the REST and SOAP APIs always return 18 characters.
Features and limitations
What it does
- Converts 15-character IDs to 18-character case-safe IDs using Salesforce’s checksum algorithm.
- Detects the format automatically: 15 characters are converted, 18 characters are verified.
- Shows the 15-character form of any 18-character ID.
- Restores letter casing from the suffix when an 18-character ID was upper-cased or lower-cased.
- Batch mode: paste thousands of IDs at once, then copy or download the results.
- Names the object for well-known key prefixes, such as
001for Account.
What it does not do
- It cannot tell you whether a record exists. A correctly formed ID is only a correctly formed ID.
- It does not connect to Salesforce, so it cannot look up record names, owners or the org an ID belongs to.
- Key prefixes of custom objects differ in every org and are not identified.
- A 15-character ID whose casing has already been lost cannot be repaired, because the casing is the missing information.