I have a huge list of 18 digit ids which either refer to a contact or an account. Is it possible to tell which is which without manually checking them all?
With just Contacts and Accounts, it's easy: if it starts with
001, it's an Account; with
003 it's a Contact.
More generally, this is called the Key Prefix, this three-digit identifier at the head of the object Id. There are more or less comprehensive references you can find online to map prefixes to objects and vice versa, but the easiest way to go from key prefix to what it is (if it's a regular old sObject) is to just put it in your URL bar:
It'll take you to the object home for that object.
With a single line of Apex, you can identify an ID's object:
This will output a value such as "Account" or "My_Custom_Object__c".
You can run this code by logging in to Salesforce, and choosing Developer Console, then Debug > Execute Anonymous from the menu.
Also, I wrote a package you can use to see ALL key prefixes available in your org (open source!). I'm also working on a Lightning version of this package.