# Salesforce ID Converter (15 to 18 Character)

> Convert Salesforce record IDs between 15 and 18 characters. The 18-character ID is the 15-character ID plus a 3-character suffix that encodes the case of the first 15 characters. Checked against the official docs on 2026-11-17.

Source: [Object Reference for the Salesforce Platform: Field Types (ID)](https://developer.salesforce.com/docs/platform/object-reference/guide/field-types.html)
Interactive converter: https://sfdxtalk.com/tools/salesforce-id-converter/

## Algorithm (15 to 18 characters)

1. Split the 15 characters into three groups of five.
2. For each group, add 1, 2, 4, 8 or 16 for an uppercase letter (A-Z) at position 0, 1, 2, 3 or 4.
3. Map each total (0-31) to a character: 0-25 become A-Z and 26-31 become 0-5.
4. Append the three characters to the 15-character ID.

To get 15 characters from an 18-character ID, remove the last three characters.

## Examples

| 15-character | 18-character |
| --- | --- |
| `001D000000IqhSL` | `001D000000IqhSLIAZ` |
| `000000000000Abc` | `000000000000AbcAAE` |
| `000000000000aBC` | `000000000000aBCAAY` |

## Key prefixes of common standard objects

Prefixes are case-sensitive and can differ between orgs. Confirm in your org with `SELECT QualifiedApiName, KeyPrefix FROM EntityDefinition WHERE KeyPrefix != null`.

| Prefix | Object | API name |
| --- | --- | --- |
| `001` | Account | Account |
| `003` | Contact | Contact |
| `005` | User | User |
| `006` | Opportunity | Opportunity |
| `007` | Activity | Activity |
| `00Q` | Lead | Lead |
| `500` | Case | Case |
| `701` | Campaign | Campaign |
| `00D` | Organization | Organization |
| `00T` | Task | Task |
| `00U` | Event | Event |
| `012` | Record Type | RecordType |
| `00e` | Profile | Profile |
| `0PS` | Permission Set | PermissionSet |
| `00G` | Group | Group |
| `00E` | User Role | UserRole |
| `01p` | Apex Class | ApexClass |
| `01q` | Apex Trigger | ApexTrigger |
| `015` | Document | Document |
| `00P` | Attachment | Attachment |
| `068` | Content Version | ContentVersion |
| `069` | Content Document | ContentDocument |
| `00X` | Email Template | EmailTemplate |
| `00O` | Report | Report |
| `01Z` | Dashboard | Dashboard |
| `01t` | Product | Product2 |
| `01s` | Price Book | Pricebook2 |
| `00k` | Opportunity Product | OpportunityLineItem |
| `02i` | Asset | Asset |
| `800` | Contract | Contract |
| `801` | Order | Order |
| `0D5` | Feed Item | FeedItem |
