your best bet is to find a specific computer model number (if a prebuilt), or a mainboard model, and look up it's supported CPU list... a particualr CPU usually has to be certified to work, or, it might not even POST with something it's BIOS does not recognize...
Compatible/identical sockets are a great start, but, sometimes some mainboards are made to handle only lesser TDP CPUs, something you'd want to know before putting down cash on a i7 wtih 95-110 watt TDP CPU, etc..