what is the maximum salesforce id length? I have to communicate it to another system that has to create an ad hoc field

  • 2
    I would tell them to create a 18 characters case-sensitive alphanumeric field.
    – Alberto
    Sep 3, 2018 at 11:27

1 Answer 1


Salesforce is using 18 character IDs.

There are also the shorter 15 char case-sensitive ones. Salesforce recommends the use of the longer one.

For more information see the official documentation on the topic: https://help.salesforce.com/articleView?id=000004383&language=en_US&type=1

  • 3
    The 18 character IDs are definitely NOT case insensitive (try to use a known ID in a query, but change one of the characters to lower case). The difference between the 15 and 18 character IDs is that the 18 character version has a sort of hash to be able to reconstruct the casing of the 15 character version. So if you have an all lower case 18 character ID you can reconstruct the proper casing, but this is not done implicitly. Sep 3, 2018 at 12:44
  • For more information see the official documentation on the topic: help.salesforce.com/… Sep 3, 2018 at 13:04
  • 2
    That documentation appears to be very old. They typically refer to 18 character Ids as "case safe", meaning they're safe to be used with tools (primarily Excel) that cannot distinguish 15-character Id values based on case differences.
    – David Reed
    Sep 3, 2018 at 13:12
  • There are lots of pages where a solution to this can be found anyway like here: developer.salesforce.com/forums/?id=906F0000000BQGnIAO OR here: help.salesforce.com/articleView?id=000003004&type=1 But your comments are not referencing the question anymore. Length = 18 he did not ask for any more information. Also, you are completely right that it is a duplicate. how can I flag it as one? Sep 4, 2018 at 15:28
  • my question was not related to how the salesforce ID is composed, I did not know whether to communicate 15 or 18 because the external system will query from the outside so I did not know how many characters it would extract. Forgive me if considered duplicate Sep 7, 2018 at 14:15

Not the answer you're looking for? Browse other questions tagged .