The size of a grain originally derived from the weight of barleycorn. Another Imperial weight unit, the pound, contains exactly 7,000 grains. To calculate how many grains are in a volume of a substance, you need to know its density. The common scientific unit for density is grams per cubic centimeter, and a gram contains 15.43 grains.
Look up the material's density, measured in grams per cubic centimeter. For example, you might want to calculate the mass of table salt, which has a density of 2.16 grams per cubic centimeter.
Multiply the substance's volume by its density. If you are converting the mass of 2 cubic centimeters of salt, you would multiply 2 by 2.16 to get 4.32. This is the material's mass, measured in grams.
Multiply this answer by 15.43. So you would calculate 4.32 x 15.43 = 66.7. This is the material's mass, measured in grains.