How to restore an iphone if you forget the passcode?

Tunes keeps telling me that it can't connect to the iPhone because "the iPhone is locked with a pass-code" and apparently I have to connect it to the iTunes to be able to restore it BUT I DON'T *** KNOW THE PASSWORD! What do I do?

Added (1). But the computer can't detect it!

Maybe you could try connecting it to your computer and when it detects the phone click restore

Reset your phone to factory settings. By syncing back to computer.

  • What to do if you forgot you iphone passcode and you didn't even put your iCloud account in? When i first got my iphone i set the passcode as 000000 but I somehow typed too fast and hit something else and i did it TWICE. I didn't even get a chance to log in my apple id account. I don't know what to do.
  • What do you do if you forget your iPhone password? There's a password that you put in when you start up the iPhone, but it is not the lock screen password. This password is used if you need to reset any of the settings. I forgot the password, how can I reset it?
  • What do you call a person who forget and always miss place things? For example, i just got a new IPhone and i went to the bathroom at school to check my hair after i was finished i left the bathroom. About ten mins later i realized i did not have my iphone. What would you call this. Oh i have also left my lab top on the bus never got it back. What would say is wrong?
  • What do I do when I forget my iPhone passcode? I was in the car with my sister yesterday and she saw me putting in my passcode so I changed it to something different but I think it was a complete random number and now I can't remember what it was. I haven't synced my phone to iTunes on my computer yet because I haven't needed music, but now I can't restore it. It says i need to unlock my iPhone before it can connect to it. Is there anything I can do?