According to DxOMark, the Nikon D3200 and the Pentax K-5 are the two best DSLRs with APS-C sized sensors on the market. Both of these cameras hold their own quite well against full-frame DSLRs and even some digital medium-format.
DxOMark puts the K-5 ever-so-slightly ahead of the D3200, ranking the Pentax camera 9th best and the Nikon camera 10th best.
If you are in the market for a new DSLR with an APS-C sized sensor, which of these two should you buy?
The K-5 has 16 megapixels and the D3200 has 24 megapixels. The D3200's eight extra megapixels will allow for somewhat larger prints or more drastic crops than the K-5. According to DxOMark, the K-5 has a slightly larger dynamic range and does slightly better at high ISO, while the D3200 has slightly more color depth.
It's too close to call which camera is better. They're both excellent DSLRs. Note that I used words like "somewhat" and "slightly" when comparing these cameras. You cannot go wrong with either.
What may be a deciding factor is cost, but even this is tricky. On one hand you have the D3200 that (with a lens) retails for $550 less than the K-5 (with a lens). You can find the K-5 discounted right now if you shop around, but the D3200 is still $350 cheaper! On the other hand, the K-5 can accept any K-mount lens, and you may have better luck finding reasonably priced lenses for the K-5 than finding reasonably priced Nikkor lenses for the D3200. So if you plan on expanding your kit, it might actually be cheaper in the long run to buy the more expensive camera, depending on exactly what lenses you buy.
Another deciding factor could be the burst rate if you are a sports or action photographer. The K-5 is capable of seven frames-per-second while the D3200 is capable of "only" four. For most people this is unimportant, but for the sports photographer this could be the difference in getting "the shot" or not.
Again, you cannot go wrong with either camera. Go with your gut and don't worry about it.