There are several ways to locate your iPhone's International Mobile Equipment Identity (IMEI) number.

Where can I find the IMEI number on the iPhone?
The IMEI number can be located by simply typing the following on the dialer keypad: *#06#

Where can I find the IMEI number on the SIM tray of the iPhone 3G, iPhone 3GS, and iPhone 4 (GSM model)?
Where can I find the IMEI number on the iPhone's "About" screen?
From the "Home" screen, select - Settings > General > About - and scroll down. The IMEI number can be located towards the bottom of the screen.

Where can I find the IMEI number on the iPhone's original packaging?
If you still have the iPhone's original packaging you can find the iPhone serial number and IMEI (or MEID) printed on the barcode label.