Do Tmobile iPhone 5's work with Tmobile prepaid sims?

I know its a pretty stupid question but I'm about to buy a used iphone 5 and I'm taking every precaution.

So does the phone need a tmobile contract or be unlocked? Or will my prepaid sim work in the tmobile iphone 5?

Why wouldn't it?

Of course it will work, there's no difference between a "contract t-mobile" sim and a "prepaid t-mobile" sim…