Answer
The entity type of every Salesforce record ID is encoded in its first three characters. This table can be used to look up the entity name. For example, given ID 00D0000000000XX, if you look up "00D" in the table below, you'll find that the entity is Organization.
Example of a Contact ID (003D0000001aH2A). The prefix Id of the contact object is 001.
Object |
Prefix Id |
Account |
001 |
Contact |
003 |
Opportunity |
006 |
Virtual Explanation