How to find out what carrier a phone is just by the phone number?
from which country you are, or the number you want to search .
if you know the country, it will be easier to find a site which informs you about the numbers of that particular country.
such sites tell you the location also with the carrier the number is registered from.
you can google the number, it will take you to the site which provides you such info.
As tina said, mobile number portability is there, so you can know, from which carrier it was registered, it is not necessary that the number is using the same carrier right now. same applies to the location of registration.
way2sms.com provides this factility for india.
And also search for applications like this.
which you can use offline.
As they just have a database.
You could search the prefix on Google.
However, that is no guarantee as phone numbers can be carried over from one carrier to another and thus typical numbers from one carrier may also under contract with another carrier after some time.