Why does my iPhone 5 which Is sold with 32 gigs say only 28.1 gigs available?

I got a 32 gig iPhone 5 and in the systems it says it's capacity is 28.1 gigs. I'm guessing it has something to do with system files and the iOS, but I'm not sure

The apps that are preinstalled with ios system make it less than 32gb

Apple's iOS takes 2gb of memory like the iphone ipod and ipad

You are correct.

True answer:
Smartphone, Tablet and Computer makers state that their Gigabyte is worth 1000MB. In reality, a GB is worth 1024MB. With a 1TB hard drive, that adds up to 69 missing GBs.

Now then, real capacity of 32GB in Apple GBs is in the 30GB (rough estimation) ballpark.

Partitioning iOS takes up about 500(iTouch 8GB 2G) - 1.7 GB(iTouch 64GB 4G), knowing from Jailbreaking. In reality, your 32GB iPhone is infact a 30GB iPhone.