iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more
Convert a quoted price per troy ounce to a per-gram reference by dividing by 31.1034768, then multiply by the gold’s purity fraction. To estimate an item’s metal value, multiply again by its eligible gold weight in grams. The result is a theoretical gold-content estimate—not a jewelry appraisal or a guaranteed buyer offer.
Understand the calculation before writing the code
Use the troy ounce conversion for precious metals, not the ordinary ounce conversion. The National Institute of Standards and Technology (NIST) gives 1 troy ounce as 31.1034768 grams in its precious-metals conversion guidance (revised March 2015).
Let spotPerTroyOunce be a quote in a stated currency, purity a fraction from 0 to 1, and weightGrams the weight of the gold alloy being valued:
Do these 3 things before closing this tab:
1Clear out junk files and repair common Windows errors2Scan for outdated or missing drivers - takes under a minute3Repair Windows errors before they cause bigger problems- 24K reference per gram:
spotPerTroyOunce / 31.1034768 - Selected-purity reference per gram:
spotPerTroyOunce / 31.1034768 * purity - Estimated item metal value:
selected-purity reference per gram * weightGrams
For karat input on a 24-part scale, calculate purity = karat / 24. NIST’s examples identify 18K as 75% gold and 12K as 50%; these illustrate the calculation and are not assay guarantees for every hallmarking regime. If accepting fineness such as parts per thousand instead, document that input convention and convert it to a fraction before multiplying.
#1 Best Overall
- The Pocket Gram Scale Size is 5.2 x 2.99 x 0.79 inch, Gram Scale allows you to weigh a maximum capacity of a 200g and the minimum accuracy is 0.01g, to guarantee you an accurate and precise weighing session. Not suitable for weighing items weighing over 200g, please choose carefully
- How to Calibrated Gram Scale? 1.Turn on the scale and wait until the LCD display 0.00 then press and HOLD MODE Key for 3 seconds, The LCD will display 'CAL', Release the MODE key. 2.Press MODE key again, The LCS will flash display the required calibration weight. 3.Add the required calibration weight onto center of the plat form, the display will show 'PASS'. Calibrtion is complete.
- Pocket Scale have easy touch buttons, large size digits and stark contrast LCD blue backlit display, makes it easy to read in all light conditions.Please note: This scale measures 5.2 x 2.99 x 0.79 inches and Gram Scaledesigned with a stainless steel platform and a protective flip cover, this pocket scale is a lightweight and Portable for easy transfer.
- Pocket Scale Featuring 6 different weight modes: g / oz / ozt / dwt /ct /gn for easy weight translations, tare function for net determination and a 60 second auto shut off to preserve battery life, The default display is grams, and other units can be switched by pressing the "mode" button
- Pocket Scale You Use the Weigh Gram scale to measure a versatile range of objects. Such as; Gold, Silver, Coins, Jewelry, Gems and other small knickknacks,It is not recommended to weigh large items, and the minimum accuracy is 0.01g.To maintain the accuracy of the weighing values, it is recommended that you calibrate before each weighing.
Check the arithmetic with a worked example
NIST’s 2015 guidance uses a reference quote of $1,181.93 per troy ounce: dividing by 31.1034768 gives approximately $38 per gram for 24K. At 18K, applying 0.75 gives $28.50 per gram before item-specific deductions or retail costs. This is an old arithmetic example, not a current gold quote; some displayed values in the guidance are rounded.
Build a calculation function with validation
Keep the calculation separate from input handling, network requests, and display formatting. This example accepts karat and optional eligible weight, rejects invalid values, and retains the unrounded result for later formatting:
const TROY_OUNCE_GRAMS = 31.1034768;
function calculateGoldValue({ spotPerTroyOunce, karat, weightGrams }) {
if (!Number.isFinite(spotPerTroyOunce) || spotPerTroyOunce < 0) {
throw new RangeError("Price must be a finite, nonnegative number.");
}
if (!Number.isFinite(karat) || karat < 0 || karat > 24) {
throw new RangeError("Karat must be between 0 and 24.");
}
const pricePerGram =
(spotPerTroyOunce / TROY_OUNCE_GRAMS) * (karat / 24);
if (weightGrams === undefined || weightGrams === null) {
return { pricePerGram };
}
if (!Number.isFinite(weightGrams) || weightGrams < 0) {
throw new RangeError("Weight must be a finite, nonnegative number.");
}
return {
pricePerGram,
estimatedMetalValue: pricePerGram * weightGrams
};
}
For fineness input, use a separate, clearly labeled path rather than silently interpreting the value as karat. For example, a documented parts-per-thousand convention converts to a fraction by dividing by 1,000; validate against the supported range for that input.
Rank #2
- 500 g Capacity with 0.01 g Readability: This gram scale measures powders, jewelry, coins, tea, and other small items accurately, helping you get consistent results for everyday weighing
- Clear Cover Tray: The included clear cover doubles as a weighing tray, helping you measure powders, tea leaves, gemstones, and other small items with less mess
- 6 Weighing Units : The mini scale supports g, oz, ozt, dwt, ct, and gn, allowing users to switch units for food, jewelry, gems, coins, and precious metals
- Smart Power Protection : AAA battery power, auto-off, and overload protection help save power, prevent damage from excess weight, and keep the gram scale ready for daily use
- Pocket Size: The compact 5.0 x 2.90 x 0.67 inch body fits easily in a pocket, bag, drawer, or toolkit, making this scale easy to carry for small-item weighing at home or on the go
Do not treat the weight of an entire piece of jewelry as gold weight by default. Stones, clasps, and other non-gold materials can contribute to an item’s scale weight. Label the field as eligible gold-alloy weight, and explain whether the user must exclude those materials.
Show the estimate and its limits clearly
Return two distinct quantities when the user enters weight: a selected-purity price per gram and an estimated total metal value. Label the currency and units beside each result so a per-gram figure cannot be mistaken for the item total.
The calculation values gold content only. It does not establish the amount a jeweler, refiner, or other buyer will pay. NIST cautions that offers may reflect karat content and deductions for other factors. Retail premiums, workmanship or making charges, taxes, fees, and transaction terms are not included in a basic metal-value calculation.
Rank #3
- Complete Testing Kit – Includes jewelry test solutions, digital scale, diamond tester, touchstone, magnifier, files, and reference bars for evaluating gold, silver, platinum, and diamonds.
- Digital Scale – Compact stainless-steel platform with 0.01 g accuracy, weighing modes for g/oz/dwt/ozt/ct/gn, and up to 100 g capacity.
- Larger 15 ml Bottles – Each test solution bottle is 0.5 oz (15 ml), three times larger than many common 5 ml bottles available, providing more tests per bottle.
- Diamond Tester & Accessories – Portable electronic tester with included sizing gauge and estimator for distinguishing diamonds from common simulants.
- Magnifier & Files – 30X triplet loupe for inspecting fine details and a 10-piece diamond needle file set for preparing samples.
Format currency without changing the calculation
JavaScript’s Intl.NumberFormat provides locale-sensitive currency display. Choose the locale and currency from the user’s context or the quote’s metadata, and format only after calculating:
function formatCurrency(value, locale, currency) {
return new Intl.NumberFormat(locale, {
style: "currency",
currency
}).format(value);
}
const result = calculateGoldValue({
spotPerTroyOunce: 1181.93,
karat: 18,
weightGrams: 10
});
const perGramText = formatCurrency(result.pricePerGram, "en-US", "USD");
const totalText = formatCurrency(
result.estimatedMetalValue,
"en-US",
"USD"
);
Here, en-US and USD are example formatting choices, not assumptions every application should make. Currency minor-unit conventions differ, so use the currency formatter and choose any additional display precision to suit the product. Do not round intermediate values repeatedly; define a settlement-rounding rule only if the application actually needs one. JavaScript binary floating-point is not exact decimal money arithmetic. The goldprice.dev API documentation returns price values as decimal strings and advises using a decimal type where exact money arithmetic matters.
Choose how the calculator gets its price
A manually entered reference price is the simplest option and avoids presenting a changing quote as current. If the calculator fetches a quote, treat it as time-stamped data: identify the provider, currency, units, and observation time in the interface. Make stale or unavailable status visible rather than silently labeling old data live.
Rank #4
- Genuine DigiWeigh 1000BX Deluxe Coin Scale with Lifetime Warranty
- Enables you to choose from Grams, Ounces, Troy Ounces, Grains, Pennyweight, and Carats
- Capacity: 1000g / 35.3oz / 32.1ozt / 15432gn / 643dwt / 5000ct
- Readability: 0.1g / 0.01oz / 0.01ozt / 1gn / 0.1dwt / 0.5ct
- Scale arrives to you pre-calibrated & ready to use; includes batteries, instructions, original packaging, and warranty information
Providers expose different fields and operational guidance. For example, World Gold Council gold-price methodology says the chart price is supplied by FastMarkets, quoted in USD, and converted into other currencies using an exchange rate at the time or as close as possible. That distinction illustrates why metal-price time and currency-conversion time may not be identical.
When evaluating a feed, check its provenance and attribution requirements, timestamp and stale-data behavior, currency and market coverage, units or purity-adjusted values, caching and rate limits, browser CORS and credential requirements, and failure behavior. Documentation alone does not establish a provider’s comparative accuracy or uptime.
Free tools Windows power users keep installed
One-click scans. No signup required.
Validate a live response and preserve its timestamp
A provider may offer an API that returns per-gram values by purity, or one that returns a reference price for your own calculation. Follow the provider’s current response schema and terms. The goldprice.dev API documentation describes purity values and decimal-string price fields. The AlyawmGold API documentation demonstrates JavaScript fetch, response checks, timestamp and stale fields, rate limits, and caching guidance; its 30-second minimum refresh recommendation applies to that provider’s latest-price endpoint, not to all APIs.
Best Value
- PORTABLE: This UNIWEIGH 200g/0.01g digital gram scale features a rubberized shock-resistant clamshell design makes scale tough,durable, with a shape that easily fits in your pocket or bag, you can use it anytime;
- 6 WEIGH MODES: Our dry herb scale built with high precision sensors to provides you instant and accurate weigh readings from 0.03g to 200g. With 6 measurement units available can be switched: g, oz, ozt, dwt, ct, gn, very suitable to use it as Jewelry Scale, Tobacco Scale, Reloading Scale,Arrow Scale;
- MULTI-PURPOSE: These UNIWEIGH powder scales crosses over as the most versatile counter top scale on the market.Great for your mobile little items, diet nutrition meals, spices, pills, gold, diamond, gems;
- EASY TO USE: Our mini digital scale is easy to use. "TARE" function can help you easily zero the weight of container; with stainless-steel platform for easy wiped clean; LCD display is easy to read in all light conditions; overload and low battery indication, 180s smart auto-off;
- ACCESSORIES: The UNIWEIGH jewellry scale comes with 50G calibration weight to re-calibrate scale by yourself, also included two AAA batteries and instruction manual to make sure scale ready to use as soon as you receive it. If you have any problem, please told us, we will provide solution in time
At minimum, check the HTTP status, validate the response fields and units, and handle network or parsing failures. If showing cached fallback data, keep its original observation time attached and mark it as stale. If a provider requires credentials, follow its current terms and do not expose secret keys in browser code.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Put the right information in the interface
Make the assumptions visible near the inputs and result. A practical form should include:
- Reference price, its currency, and whether it is per troy ounce or another unit.
- Source or provider and quote timestamp; for dynamic data, a visible stale or unavailable status.
- Purity value and convention, such as karat out of 24 or documented fineness.
- Optional weight in grams, clearly described as eligible gold-alloy weight rather than total jewelry weight.
- Separate labels for selected-purity value per gram and estimated total metal value.
Provide validation feedback for negative, non-finite, or out-of-range inputs. If a quote cannot be retrieved, do not leave a previously displayed value looking current: preserve its timestamp and status or remove the result until a valid quote is available.
Frequently Asked Questions
How much is gold per gram?
It depends on the reference price, its currency and timestamp, and the purity. Divide a per-troy-ounce quote by 31.1034768 for a 24K per-gram reference, then multiply by the purity fraction for a selected karat. A live result is meaningful only with its source and observation time.
How do I work out how much my gold is worth?
For an estimated metal value, calculate (price per troy ounce ÷ 31.1034768) × purity fraction × eligible gold weight in grams. This estimates gold content, not a guaranteed sale price; a buyer may apply deductions or other transaction terms.
How much is 100 grams of gold?
Multiply the selected-purity per-gram reference by 100, using a quote with a stated currency and timestamp. For an item, use its eligible gold-alloy weight; total jewelry weight may include stones or other materials, and the estimate is not a guaranteed offer.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.

