Conversion Utilities

Grams To Ounces

Converts grams to ounces with precise decimal output using the standard conversion factor (1 ounce = 28.3495 grams). Access via MCP in Cursor or Windsurf for instant weight calculations, or call GET /v1/convert/weight/g-to-oz?grams=100 to get 3.5274 oz. Perfect for recipe scaling, shipping calculations, and scientific measurements requiring accurate conversions.

API Endpoint

GET /v1/convert/weight/g-to-oz

Code Examples

curl "https://tinyfn.io/v1/convert/weight/g-to-oz" \
  -H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/convert/weight/g-to-oz', {
  headers: { 'X-API-Key': 'YOUR_API_KEY' }
});
const data = await response.json();
console.log(data);
import requests

response = requests.get('https://tinyfn.io/v1/convert/weight/g-to-oz',
    headers={'X-API-Key': 'YOUR_API_KEY'})
data = response.json()
print(data)

Use via MCP

Add to your AI agent

Connect your AI agent (Claude, Cursor, Windsurf, etc.) to TinyFn's conversion tools:

{
  "mcpServers": {
    "tinyfn-conversion": {
      "url": "https://tinyfn.io/mcp/conversion",
      "headers": {
        "X-API-Key": "YOUR_API_KEY"
      }
    }
  }
}

Learn more about MCP setup →

FAQ

How accurate is the grams to ounces conversion?

Uses the precise conversion factor of 1 ounce = 28.34952312 grams, returning results to 4 decimal places for scientific accuracy.

Can I convert multiple gram values at once using MCP?

Each MCP call handles one conversion, but AI agents like Claude can quickly process multiple values by making sequential calls within the same conversation.

What's the difference between avoirdupois and troy ounces?

This tool converts to avoirdupois ounces (standard weight), not troy ounces used for precious metals. Troy ounces are heavier at 31.1035 grams each.

Does the API handle fractional grams?

Yes, accepts decimal gram values like 15.7g or 0.25g and returns proportionally accurate ounce conversions.

What happens if I pass negative or zero gram values?

Zero grams returns 0 ounces. Negative values may return an error or negative ounce result depending on implementation requirements.

Try Grams To Ounces Now

Get your free API key and start using Grams To Ounces in seconds.

Get Free API Key