Start with compatible inputs
You need net metal weight, purity and a reference price in a matching currency and unit. Convert a troy-ounce quote to a gram quote by dividing by 31.1034768. Check its timestamp too: reliable inputs matter more than the number of decimal places displayed in the answer.
Apply purity once
Using a fine-gold gram price, the nominal formula is weight in grams × K/24 × fine-gold price per gram. As an arithmetic example, 12 grams of 18K has a nominal fine-gold equivalent of 9 grams. At an illustrative fine-gold price of 100 currency units per gram, the metal estimate is 900 units.
If your input is already the price per gram of 18K, multiply that price directly by the 18K weight. Do not apply 18/24 a second time. A documented actual fineness such as 0.750 can replace a nominal karat fraction.
Read the result correctly
The calculation estimates gold content at the selected reference price; it does not verify authenticity or assay an item. It also does not value stones, craftsmanship or collectability. Exclude known non-gold components, and recalculate whenever you change weight or purity.
Compare the estimate with an actual offer only after separating stated charges and deductions. The realised selling amount can depend on testing, processing and the other party's terms. Keep a note of the inputs alongside the result so you can reproduce the comparison later.