Converting 15-Character Salesforce IDs to 18 Characters

I spent the past few days baselining the data in a system that one of our Salesforce Orgs will be integrating with. Unfortunately I have to convert our Salesforce record IDs into the 18-character form because this system’s database isn’t set up to handle the case-sensitive 15-character IDs. This is something I used to do frequently as a consultant and I had various scripts in my toolbelt but I went a-searching to see what the ecosystem had created since then. And there are quite a few options! From scripts in various languages to online tools but I found all of them missing key features I needed i.e.

  1. If an input ID is ill-formed then only output an error for that ID and give me the rest of the correct results too
  2. Deal with all sorts of problems with the input IDs (most tools just check for the string length)
  3. Give me the result along with the ID (comma separated) it belongs to
  4. Let me copy-and-paste the result, or let me download it as a CSV
  5. Make it capable of handling 10s of thousands of input IDs
  6. Let the input IDs be either one-per-line or comma-separated

To address these gaps I created an NPM package as well as an online ID converter. So you can also benefit from these additional (admittedly small but important to me) benefits.

screenshot of the salesforce ID converter at ratedcalculator.com

Leave a Comment