Exclamation [Q] Samsung S3: Formatting phone without access to screen.

I have an S3 which has a cracked. I'll probably be selling it as it isn't feasible to repair as the screen is quite expensive. In any case, how can I format the phone, without access to the screen. Can it be done by the PC? Or perhaps a guide using the hardware keys somehow?