Your Facebook profile or Facebook page have a unique ID associated with them. The software system of Facebook identifies you by this particular ID. This ID is part of the address of your Facebook timeline. For example:
Clearly, remembering such a long number is difficult for us. So, when you create a new FB profile or page, Facebook allows you to create a custom URL by selecting a user name for your profile or page. Therefore, the above URL becomes something like:
Now, it is much easier to remember your Facebook URL. But the downside of this approach is that in case you need your Facebook ID, you wouldn't know where to look for it!
We have said that FB ID uniquely identify you in the Facebook system. If you're developing an app which reads or modifies Facebook data of a user, you would need to tell your app exactly which user you're talking about. Facebook system will not understand calls from your app if it provides the custom user name. Facebook API will expect you to provide Facebook ID.
If your Facebook URL is contains profile.php?id= then the number given after the equal to sign is your FB ID.
If you have already chosen a custom username, then your ID would be not be part of the URL. However, you can still find it in the source code of the page. For this: