One troy ounce contains 31.103 grams, and one ounce(avoirdupois) contains 28.3495 grams, so it all depends on what you are measuring and if it is solid or liquid.
One ounce equals 28.3495 grams. I found this answer with a great Google feature -- just type "convert ounces to grams" and you get the conversion. This works for other measurement conversions too.